com.tc.object.bytecode
Class ManagerUtil

java.lang.Object
  extended by com.tc.object.bytecode.ManagerUtil

public class ManagerUtil
extends java.lang.Object

A bunch of static methods that make calling Manager method much easier from instrumented classes


Field Summary
static java.lang.String CLASS
          This class name
static java.lang.String TYPE
          This class type
 
Method Summary
static void arraycopy(java.lang.Object src, int srcPos, java.lang.Object dest, int destPos, int length)
          Handle System.arraycopy() semantics with managed arrays
static void beginLock(java.lang.String lockID, int type)
          Begin lock
static void beginLock(java.lang.String lockID, int type, java.lang.String contextInfo)
          Deprecated. 
static void beginLockWithoutTxn(java.lang.String lockID, int type)
          Deprecated. 
static void beginVolatile(java.lang.Object pojo, long fieldOffset, int type)
          Begin volatile lock by field offset in the class
static void beginVolatile(TCObjectExternal TCObjectExternal, java.lang.String fieldName, int type)
          Begin volatile lock
static void byteOrBooleanArrayChanged(java.lang.Object array, int index, byte value)
          Indicate that byte or boolean in array changed
static int calculateDsoHashCode(java.lang.Object obj)
           
static void charArrayChanged(char[] array, int index, char value)
          Indicate that char in array changed
static void charArrayCopy(char[] src, int srcPos, char[] dest, int destPos, int length, TCObjectExternal tco)
          Copy char[]
static void checkWriteAccess(java.lang.Object context)
          Check whether current context has write access
static void clearSingleton()
           
static void commitLock(java.lang.String lockID, int type)
          Commit lock
static void commitVolatile(java.lang.Object pojo, long fieldOffset, int type)
          Commit volatile lock by field offset in the class
static void commitVolatile(TCObjectExternal TCObjectExternal, java.lang.String fieldName, int type)
          Commit volatile lock
static java.lang.Object createOrReplaceRoot(java.lang.String rootName, java.lang.Object object)
          Create or replace root, typically used for replaceable roots.
static boolean distributedMethodCall(java.lang.Object receiver, java.lang.String method, java.lang.Object[] params)
          Perform distributed method call on all nodes
static void distributedMethodCallCommit()
          Commit DMI call
static void doubleArrayChanged(double[] array, int index, double value)
          Indicate that double in array changed
static void enable()
          Called when initialization has proceeded enough that the Manager can be used.
static void enableSingleton(Manager singleton)
           
static void floatArrayChanged(float[] array, int index, float value)
          Indicate that float in array changed
static java.lang.Object get(java.lang.Object array, int index)
          For java.lang.reflect.Array.get()
static java.lang.String getClientID()
          Get JVM Client identifier
static TCLogger getLogger(java.lang.String loggerName)
          Get the named logger
static Manager getManager()
           
static TCObjectExternal getObject(java.lang.Object array)
          Get the TCO for an array
static SessionConfiguration getSessionConfiguration(java.lang.String appName)
          Get the configuration for the given application name (ie.
static TCProperties getTCProperties()
           
static java.lang.String getUUID()
          Get Unique Client identifier
static void instrumentationMonitorEnter(java.lang.Object obj, int type)
          Deprecated. 
static void instrumentationMonitorExit(java.lang.Object obj, int type)
          Deprecated. 
static void intArrayChanged(int[] array, int index, int value)
          Indicate that int in array changed
static boolean isDsoMonitored(java.lang.Object obj)
          Check whether an object is shared
static boolean isDsoMonitorEntered(java.lang.Object obj)
          Check whether dso MonitorExist is required
static boolean isFieldPortableByOffset(java.lang.Object pojo, long fieldOffset)
          Returns true if the field represented by the offset is a portable field, i.e., not static and not dso transient
static boolean isHeldByCurrentThread(java.lang.Object obj, int lockLevel)
          Check whether this lock is held by the current thread
static boolean isLiteralInstance(java.lang.Object obj)
           
static boolean isLocked(java.lang.Object obj, int lockLevel)
          Check whether an object is locked at this lockLevel
static boolean isLockHeldByCurrentThread(java.lang.String lockId, int lockLevel)
          Check whether this lock is held by the current thread
static boolean isLogical(java.lang.Object obj)
          Check whether object is logically instrumented
static boolean isManaged(java.lang.Object obj)
          Check whether an object is managed
static boolean isManagerEnabled()
           
static boolean isPhysicallyInstrumented(java.lang.Class clazz)
          Determine whether this class is physically instrumented
static boolean isRoot(java.lang.reflect.Field field)
          Check whether field is a root
static int localHeldCount(java.lang.Object obj, int lockLevel)
          Get number of locks held locally on this object
static void logicalInvoke(java.lang.Object object, java.lang.String methodName, java.lang.Object[] params)
          Perform invoke on logical managed object
static void logicalInvokeWithTransaction(java.lang.Object object, java.lang.Object lockObject, java.lang.String methodName, java.lang.Object[] params)
          Perform invoke on logical managed object in lock
static void longArrayChanged(long[] array, int index, long value)
          Indicate that long in array changed
static TCObjectExternal lookupExistingOrNull(java.lang.Object pojo)
          Find managed object, which may be null
static java.lang.Object lookupObject(ObjectID id)
          Look up object by ID, faulting into the JVM if necessary
static java.lang.Object lookupObjectWithParentContext(ObjectID id, ObjectID parentContext)
          Look up object by ID, faulting into the JVM if necessary, This method also passes the parent Object context so that more intelligent prefetching is possible at the L2.
static TCObjectExternal lookupOrCreate(java.lang.Object obj)
          Find or create new TCObjectExternal
static java.lang.Object lookupOrCreateRoot(java.lang.String name, java.lang.Object object)
          Look up or create a new root object
static java.lang.Object lookupOrCreateRootNoDepth(java.lang.String name, java.lang.Object obj)
          Look up or create a new root object.
static java.lang.Object lookupRoot(java.lang.String name)
          Lookup root by name
static void monitorEnter(java.lang.Object obj, int type)
          Enter synchronized monitor
static void monitorEnter(java.lang.Object obj, int type, java.lang.String contextInfo)
          Deprecated. 
static void monitorEnterInterruptibly(java.lang.Object obj, int type)
          Enter synchronized monitor (interruptibly).
static void monitorExit(java.lang.Object obj, int type)
          Exit synchronized monitor
static void objectArrayChanged(java.lang.Object[] array, int index, java.lang.Object value)
          Indicate that object in array changed
static void objectNotify(java.lang.Object obj)
          Perform notify on obj
static void objectNotifyAll(java.lang.Object obj)
          Perform notifyAll on obj
static void objectWait(java.lang.Object obj)
          Perform untimed wait on obj
static void objectWait(java.lang.Object obj, long millis)
          Perform timed wait on obj
static void objectWait(java.lang.Object obj, long millis, int nanos)
          Perform timed wait on obj
static boolean overridesHashCode(java.lang.Object obj)
           
static void pinLock(java.lang.String lockID)
           
static void preFetchObject(ObjectID id)
          Prefetch object by ID, faulting into the JVM if necessary, Async lookup and will not cause ObjectNotFoundException like lookupObject.
static boolean prunedDistributedMethodCall(java.lang.Object receiver, java.lang.String method, java.lang.Object[] params)
          Perform distributed method call on just this node
static int queueLength(java.lang.Object obj)
          Number in queue waiting on this lock
static void register(java.lang.Object array, TCObjectExternal obj)
          Register an array with its TCO.
static void registerNamedLoader(NamedClassLoader loader, java.lang.String webAppName)
           
static void registerStatisticRetrievalAction(StatisticRetrievalAction sra)
           
static void set(java.lang.Object array, int index, java.lang.Object value)
          This method is part of java.lang.reflect.Array and does the same as the set() method in the Sun JDK, the IBM version of the set method just adds a series of argument checks and then delegates to the native setImpl version.
static void setBoolean(java.lang.Object array, int index, boolean z)
          Set boolean value in array
static void setByte(java.lang.Object array, int index, byte b)
          Set byte value in array
static void setChar(java.lang.Object array, int index, char c)
          Set int value in array
static void setDouble(java.lang.Object array, int index, double d)
          Set double value in array
static void setFloat(java.lang.Object array, int index, float f)
          Set float value in array
static void setImpl(java.lang.Object array, int index, java.lang.Object value)
          This method is part of java.lang.reflect.Array and does the same as the set() method in the Sun JDK, the IBM version of the set method just adds a series of argument checks and then delegates to the native setImpl version.
static void setInt(java.lang.Object array, int index, int i)
          Set int value in array
static void setLong(java.lang.Object array, int index, long l)
          Set long value in array
static void setShort(java.lang.Object array, int index, short s)
          Set short value in array
static void shortArrayChanged(short[] array, int index, short value)
          Indicate that short in array changed
static boolean tryBeginLock(java.lang.String lockID, int type)
          Try to begin lock
static boolean tryBeginLock(java.lang.String lockID, int type, long timeoutInNanos)
          Try to begin lock within a specific timespan
static boolean tryMonitorEnter(java.lang.Object obj, int type)
           
static boolean tryMonitorEnter(java.lang.Object obj, int type, long timeoutInNanos)
          Try to enter monitor for specified object
static void unpinLock(java.lang.String lockID)
           
static void waitForAllCurrentTransactionsToComplete()
           
static int waitLength(java.lang.Object obj)
          Number in queue waiting on this wait()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS

public static final java.lang.String CLASS
This class name

See Also:
Constant Field Values

TYPE

public static final java.lang.String TYPE
This class type

See Also:
Constant Field Values
Method Detail

enable

public static void enable()
Called when initialization has proceeded enough that the Manager can be used.


enableSingleton

public static void enableSingleton(Manager singleton)

clearSingleton

public static void clearSingleton()

isManagerEnabled

public static boolean isManagerEnabled()

getManager

public static Manager getManager()

getLogger

public static TCLogger getLogger(java.lang.String loggerName)
Get the named logger

Parameters:
loggerName - Logger name
Returns:
The logger

isPhysicallyInstrumented

public static boolean isPhysicallyInstrumented(java.lang.Class clazz)
Determine whether this class is physically instrumented

Parameters:
clazz - Class
Returns:
True if physically instrumented

getClientID

public static java.lang.String getClientID()
Get JVM Client identifier

Returns:
Client identifier

getUUID

public static java.lang.String getUUID()
Get Unique Client identifier

Returns:
Unique Client identifier

registerStatisticRetrievalAction

public static void registerStatisticRetrievalAction(StatisticRetrievalAction sra)

lookupOrCreateRoot

public static java.lang.Object lookupOrCreateRoot(java.lang.String name,
                                                  java.lang.Object object)
Look up or create a new root object

Parameters:
name - Root name
object - Root object to use if none exists yet
Returns:
The root object actually used, may or may not == object

lookupOrCreateRootNoDepth

public static java.lang.Object lookupOrCreateRootNoDepth(java.lang.String name,
                                                         java.lang.Object obj)
Look up or create a new root object. Objects faulted in to arbitrary depth.

Parameters:
name - Root name
obj - Root object to use if none exists yet
Returns:
The root object actually used, may or may not == object

createOrReplaceRoot

public static java.lang.Object createOrReplaceRoot(java.lang.String rootName,
                                                   java.lang.Object object)
Create or replace root, typically used for replaceable roots.

Parameters:
rootName - Root name
object - Root object
Returns:
Root object used

beginVolatile

public static void beginVolatile(java.lang.Object pojo,
                                 long fieldOffset,
                                 int type)
Begin volatile lock by field offset in the class

Parameters:
pojo - Instance containing field
fieldOffset - Field offset in pojo
type - Lock level

commitVolatile

public static void commitVolatile(java.lang.Object pojo,
                                  long fieldOffset,
                                  int type)
Commit volatile lock by field offset in the class

Parameters:
pojo - Instance containing field
fieldOffset - Field offset in pojo

beginVolatile

public static void beginVolatile(TCObjectExternal TCObjectExternal,
                                 java.lang.String fieldName,
                                 int type)
Begin volatile lock

Parameters:
TCObjectExternal - TCObjectExternal to lock
fieldName - Field name holding volatile object
type - Lock type

beginLock

public static void beginLock(java.lang.String lockID,
                             int type)
Begin lock

Parameters:
lockID - Lock identifier
type - Lock type

beginLockWithoutTxn

@Deprecated
public static void beginLockWithoutTxn(java.lang.String lockID,
                                                  int type)
Deprecated. 

Begins a lock without associating any transaction context.


beginLock

@Deprecated
public static void beginLock(java.lang.String lockID,
                                        int type,
                                        java.lang.String contextInfo)
Deprecated. 

Begin lock

Parameters:
lockID - Lock identifier
type - Lock type
contextInfo -

tryBeginLock

public static boolean tryBeginLock(java.lang.String lockID,
                                   int type)
Try to begin lock

Parameters:
lockID - Lock identifier
type - Lock type
Returns:
True if lock was successful

tryBeginLock

public static boolean tryBeginLock(java.lang.String lockID,
                                   int type,
                                   long timeoutInNanos)
                            throws java.lang.InterruptedException
Try to begin lock within a specific timespan

Parameters:
lockID - Lock identifier
type - Lock type
timeoutInNanos - Timeout in nanoseconds
Returns:
True if lock was successful
Throws:
java.lang.InterruptedException

commitVolatile

public static void commitVolatile(TCObjectExternal TCObjectExternal,
                                  java.lang.String fieldName,
                                  int type)
Commit volatile lock

Parameters:
TCObjectExternal - Volatile object TCObjectExternal
fieldName - Field holding the volatile object

commitLock

public static void commitLock(java.lang.String lockID,
                              int type)
Commit lock

Parameters:
lockID - Lock name

pinLock

public static void pinLock(java.lang.String lockID)

unpinLock

public static void unpinLock(java.lang.String lockID)

lookupExistingOrNull

public static TCObjectExternal lookupExistingOrNull(java.lang.Object pojo)
Find managed object, which may be null

Parameters:
pojo - The object instance
Returns:
The TCObjectExternal

logicalInvoke

public static void logicalInvoke(java.lang.Object object,
                                 java.lang.String methodName,
                                 java.lang.Object[] params)
Perform invoke on logical managed object

Parameters:
object - The object
methodName - The method to call
params - The parameters to the method

logicalInvokeWithTransaction

public static void logicalInvokeWithTransaction(java.lang.Object object,
                                                java.lang.Object lockObject,
                                                java.lang.String methodName,
                                                java.lang.Object[] params)
Perform invoke on logical managed object in lock

Parameters:
object - The object
lockObject - The lock object
methodName - The method to call
params - The parameters to the method

distributedMethodCallCommit

public static void distributedMethodCallCommit()
Commit DMI call


prunedDistributedMethodCall

public static boolean prunedDistributedMethodCall(java.lang.Object receiver,
                                                  java.lang.String method,
                                                  java.lang.Object[] params)
Perform distributed method call on just this node

Parameters:
receiver - The receiver object
method - The method to call
params - The parameter values

distributedMethodCall

public static boolean distributedMethodCall(java.lang.Object receiver,
                                            java.lang.String method,
                                            java.lang.Object[] params)
Perform distributed method call on all nodes

Parameters:
receiver - The receiver object
method - The method to call
params - The parameter values

lookupRoot

public static java.lang.Object lookupRoot(java.lang.String name)
Lookup root by name

Parameters:
name - Name of root
Returns:
Root object

lookupObject

public static java.lang.Object lookupObject(ObjectID id)
Look up object by ID, faulting into the JVM if necessary

Parameters:
id - Object identifier
Returns:
The actual object
Throws:
TCClassNotFoundException - If a class is not found during faulting

preFetchObject

public static void preFetchObject(ObjectID id)
Prefetch object by ID, faulting into the JVM if necessary, Async lookup and will not cause ObjectNotFoundException like lookupObject. Non-existent objects are ignored by the server.

Parameters:
id - Object identifier

lookupObjectWithParentContext

public static java.lang.Object lookupObjectWithParentContext(ObjectID id,
                                                             ObjectID parentContext)
Look up object by ID, faulting into the JVM if necessary, This method also passes the parent Object context so that more intelligent prefetching is possible at the L2.

Parameters:
id - Object identifier of the object we are looking up
parentContext - Object identifier of the parent object
Returns:
The actual object
Throws:
TCClassNotFoundException - If a class is not found during faulting

lookupOrCreate

public static TCObjectExternal lookupOrCreate(java.lang.Object obj)
Find or create new TCObjectExternal

Parameters:
obj - The object instance
Returns:
The TCObjectExternal

checkWriteAccess

public static void checkWriteAccess(java.lang.Object context)
Check whether current context has write access

Parameters:
context - Context object
Throws:
com.tc.object.util.ReadOnlyException - If in read-only transaction

isManaged

public static boolean isManaged(java.lang.Object obj)
Check whether an object is managed

Parameters:
obj - Instance
Returns:
True if managed

isDsoMonitored

public static boolean isDsoMonitored(java.lang.Object obj)
Check whether an object is shared

Parameters:
obj - Instance
Returns:
True if shared

isDsoMonitorEntered

public static boolean isDsoMonitorEntered(java.lang.Object obj)
Check whether dso MonitorExist is required

Returns:
True if required

isLogical

public static boolean isLogical(java.lang.Object obj)
Check whether object is logically instrumented

Parameters:
obj - Instance
Returns:
True if logically instrumented

isRoot

public static boolean isRoot(java.lang.reflect.Field field)
Check whether field is a root

Parameters:
field - Field
Returns:
True if root

objectNotify

public static void objectNotify(java.lang.Object obj)
Perform notify on obj

Parameters:
obj - Instance

objectNotifyAll

public static void objectNotifyAll(java.lang.Object obj)
Perform notifyAll on obj

Parameters:
obj - Instance

objectWait

public static void objectWait(java.lang.Object obj)
                       throws java.lang.InterruptedException
Perform untimed wait on obj

Parameters:
obj - Instance
Throws:
java.lang.InterruptedException

objectWait

public static void objectWait(java.lang.Object obj,
                              long millis)
                       throws java.lang.InterruptedException
Perform timed wait on obj

Parameters:
obj - Instance
millis - Wait time
Throws:
java.lang.InterruptedException

objectWait

public static void objectWait(java.lang.Object obj,
                              long millis,
                              int nanos)
                       throws java.lang.InterruptedException
Perform timed wait on obj

Parameters:
obj - Instance
millis - Wait time
nanos - More wait time
Throws:
java.lang.InterruptedException

monitorEnter

public static void monitorEnter(java.lang.Object obj,
                                int type)
Enter synchronized monitor

Parameters:
obj - Object
type - Lock type

monitorEnter

@Deprecated
public static void monitorEnter(java.lang.Object obj,
                                           int type,
                                           java.lang.String contextInfo)
Deprecated. 

Enter synchronized monitor

Parameters:
obj - Object
type - Lock type
contextInfo - Configuration text of the lock

monitorExit

public static void monitorExit(java.lang.Object obj,
                               int type)
Exit synchronized monitor

Parameters:
obj - Object

instrumentationMonitorEnter

@Deprecated
public static void instrumentationMonitorEnter(java.lang.Object obj,
                                                          int type)
Deprecated. 


instrumentationMonitorExit

@Deprecated
public static void instrumentationMonitorExit(java.lang.Object obj,
                                                         int type)
Deprecated. 


isLiteralInstance

public static boolean isLiteralInstance(java.lang.Object obj)
Returns:
true if obj is an instance of a literal type, e.g., Class, Integer, etc.

calculateDsoHashCode

public static int calculateDsoHashCode(java.lang.Object obj)
Returns:
a hash code that will be the same on all nodes

isLocked

public static boolean isLocked(java.lang.Object obj,
                               int lockLevel)
Check whether an object is locked at this lockLevel

Parameters:
obj - Lock
lockLevel - Lock level
Returns:
True if locked at this level
Throws:
java.lang.NullPointerException - If obj is null

tryMonitorEnter

public static boolean tryMonitorEnter(java.lang.Object obj,
                                      int type)

tryMonitorEnter

public static boolean tryMonitorEnter(java.lang.Object obj,
                                      int type,
                                      long timeoutInNanos)
                               throws java.lang.InterruptedException
Try to enter monitor for specified object

Parameters:
obj - The object monitor
timeoutInNanos - Timeout in nanoseconds
type - The lock level
Returns:
True if entered
Throws:
java.lang.NullPointerException - If obj is null
java.lang.InterruptedException

monitorEnterInterruptibly

public static void monitorEnterInterruptibly(java.lang.Object obj,
                                             int type)
                                      throws java.lang.InterruptedException
Enter synchronized monitor (interruptibly).

Parameters:
obj - The object monitor
type - The lock level
Throws:
java.lang.NullPointerException - If obj is null
java.lang.InterruptedException - If interrupted while entering or waiting

localHeldCount

public static int localHeldCount(java.lang.Object obj,
                                 int lockLevel)
Get number of locks held locally on this object

Parameters:
obj - The lock object
lockLevel - The lock level
Returns:
Lock count
Throws:
java.lang.NullPointerException - If obj is null

isHeldByCurrentThread

public static boolean isHeldByCurrentThread(java.lang.Object obj,
                                            int lockLevel)
Check whether this lock is held by the current thread

Parameters:
obj - The lock
lockLevel - The lock level
Returns:
True if held by current thread
Throws:
java.lang.NullPointerException - If obj is null

isLockHeldByCurrentThread

public static boolean isLockHeldByCurrentThread(java.lang.String lockId,
                                                int lockLevel)
Check whether this lock is held by the current thread

Parameters:
lockId - The lock ID
lockLevel - The lock level
Returns:
True if held by current thread

queueLength

public static int queueLength(java.lang.Object obj)
Number in queue waiting on this lock

Parameters:
obj - The object
Returns:
Number of waiters
Throws:
java.lang.NullPointerException - If obj is null

waitLength

public static int waitLength(java.lang.Object obj)
Number in queue waiting on this wait()

Parameters:
obj - The object
Returns:
Number of waiters
Throws:
java.lang.NullPointerException - If obj is null

get

public static java.lang.Object get(java.lang.Object array,
                                   int index)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.ArrayIndexOutOfBoundsException
For java.lang.reflect.Array.get()

Parameters:
array - The array
index - Index into the array
Returns:
Item in array at index, boxed to Object if primitive array
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is not an array type
java.lang.ArrayIndexOutOfBoundsException

setImpl

public static void setImpl(java.lang.Object array,
                           int index,
                           java.lang.Object value)
                    throws java.lang.IllegalArgumentException,
                           java.lang.ArrayIndexOutOfBoundsException
This method is part of java.lang.reflect.Array and does the same as the set() method in the Sun JDK, the IBM version of the set method just adds a series of argument checks and then delegates to the native setImpl version.

Parameters:
array - Array
index - Index in array
value - New value
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is an unexpected array type
java.lang.ArrayIndexOutOfBoundsException - If index is not in valid range for array

set

public static void set(java.lang.Object array,
                       int index,
                       java.lang.Object value)
                throws java.lang.IllegalArgumentException,
                       java.lang.ArrayIndexOutOfBoundsException
This method is part of java.lang.reflect.Array and does the same as the set() method in the Sun JDK, the IBM version of the set method just adds a series of argument checks and then delegates to the native setImpl version.

Parameters:
array - Array
index - Index in array
value - New value
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is an unexpected array type
java.lang.ArrayIndexOutOfBoundsException - If index is not in valid range for array

setBoolean

public static void setBoolean(java.lang.Object array,
                              int index,
                              boolean z)
                       throws java.lang.IllegalArgumentException,
                              java.lang.ArrayIndexOutOfBoundsException
Set boolean value in array

Parameters:
array - Array
index - Index in array
z - New boolean value
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is an unexpected array type
java.lang.ArrayIndexOutOfBoundsException - If index is not in valid range for array

setByte

public static void setByte(java.lang.Object array,
                           int index,
                           byte b)
                    throws java.lang.IllegalArgumentException,
                           java.lang.ArrayIndexOutOfBoundsException
Set byte value in array

Parameters:
array - Array
index - Index in array
b - New byte value
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is an unexpected array type
java.lang.ArrayIndexOutOfBoundsException - If index is not in valid range for array

setChar

public static void setChar(java.lang.Object array,
                           int index,
                           char c)
                    throws java.lang.IllegalArgumentException,
                           java.lang.ArrayIndexOutOfBoundsException
Set int value in array

Parameters:
array - Array
index - Index in array
c - New int value
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is an unexpected array type
java.lang.ArrayIndexOutOfBoundsException - If index is not in valid range for array

setShort

public static void setShort(java.lang.Object array,
                            int index,
                            short s)
                     throws java.lang.IllegalArgumentException,
                            java.lang.ArrayIndexOutOfBoundsException
Set short value in array

Parameters:
array - Array
index - Index in array
s - New short value
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is an unexpected array type
java.lang.ArrayIndexOutOfBoundsException - If index is not in valid range for array

setInt

public static void setInt(java.lang.Object array,
                          int index,
                          int i)
                   throws java.lang.IllegalArgumentException,
                          java.lang.ArrayIndexOutOfBoundsException
Set int value in array

Parameters:
array - Array
index - Index in array
i - New int value
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is an unexpected array type
java.lang.ArrayIndexOutOfBoundsException - If index is not in valid range for array

setLong

public static void setLong(java.lang.Object array,
                           int index,
                           long l)
                    throws java.lang.IllegalArgumentException,
                           java.lang.ArrayIndexOutOfBoundsException
Set long value in array

Parameters:
array - Array
index - Index in array
l - New long value
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is an unexpected array type
java.lang.ArrayIndexOutOfBoundsException - If index is not in valid range for array

setFloat

public static void setFloat(java.lang.Object array,
                            int index,
                            float f)
                     throws java.lang.IllegalArgumentException,
                            java.lang.ArrayIndexOutOfBoundsException
Set float value in array

Parameters:
array - Array
index - Index in array
f - New float value
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is an unexpected array type
java.lang.ArrayIndexOutOfBoundsException - If index is not in valid range for array

setDouble

public static void setDouble(java.lang.Object array,
                             int index,
                             double d)
                      throws java.lang.IllegalArgumentException,
                             java.lang.ArrayIndexOutOfBoundsException
Set double value in array

Parameters:
array - Array
index - Index in array
d - New double value
Throws:
java.lang.NullPointerException - If array is null
java.lang.IllegalArgumentException - If array is an unexpected array type
java.lang.ArrayIndexOutOfBoundsException - If index is not in valid range for array

objectArrayChanged

public static void objectArrayChanged(java.lang.Object[] array,
                                      int index,
                                      java.lang.Object value)
Indicate that object in array changed

Parameters:
array - The array
index - The index into array
value - The new value

shortArrayChanged

public static void shortArrayChanged(short[] array,
                                     int index,
                                     short value)
Indicate that short in array changed

Parameters:
array - The array
index - The index into array
value - The new value

longArrayChanged

public static void longArrayChanged(long[] array,
                                    int index,
                                    long value)
Indicate that long in array changed

Parameters:
array - The array
index - The index into array
value - The new value

intArrayChanged

public static void intArrayChanged(int[] array,
                                   int index,
                                   int value)
Indicate that int in array changed

Parameters:
array - The array
index - The index into array
value - The new value

floatArrayChanged

public static void floatArrayChanged(float[] array,
                                     int index,
                                     float value)
Indicate that float in array changed

Parameters:
array - The array
index - The index into array
value - The new value

doubleArrayChanged

public static void doubleArrayChanged(double[] array,
                                      int index,
                                      double value)
Indicate that double in array changed

Parameters:
array - The array
index - The index into array
value - The new value

charArrayChanged

public static void charArrayChanged(char[] array,
                                    int index,
                                    char value)
Indicate that char in array changed

Parameters:
array - The array
index - The index into array
value - The new value

byteOrBooleanArrayChanged

public static void byteOrBooleanArrayChanged(java.lang.Object array,
                                             int index,
                                             byte value)
Indicate that byte or boolean in array changed

Parameters:
array - The array
index - The index into array
value - The new value

arraycopy

public static void arraycopy(java.lang.Object src,
                             int srcPos,
                             java.lang.Object dest,
                             int destPos,
                             int length)
Handle System.arraycopy() semantics with managed arrays

Parameters:
src - Source array
srcPos - Start index in source
dest - Destination array
destPos - Destination start index
length - Number of items to copy
Throws:
java.lang.NullPointerException - If src or dest is null

getObject

public static TCObjectExternal getObject(java.lang.Object array)
Get the TCO for an array

Parameters:
array - The array instance
Returns:
The TCObjectExternal

charArrayCopy

public static void charArrayCopy(char[] src,
                                 int srcPos,
                                 char[] dest,
                                 int destPos,
                                 int length,
                                 TCObjectExternal tco)
Copy char[]

Parameters:
src - Source array
srcPos - Start in src
dest - Destination array
destPos - Start in dest
length - Number of items to copy
tco - TCObjectExternal for dest array

register

public static void register(java.lang.Object array,
                            TCObjectExternal obj)
Register an array with its TCO. It is an error to register an array that has already been registered.

Parameters:
array - Array
obj - TCObjectExternal
Throws:
java.lang.NullPointerException - if array or tco are null

getTCProperties

public static TCProperties getTCProperties()
Returns:
TCProperties

getSessionConfiguration

public static SessionConfiguration getSessionConfiguration(java.lang.String appName)
Get the configuration for the given application name (ie. context path)

Returns:
null if the given app is not configured for clustering

isFieldPortableByOffset

public static boolean isFieldPortableByOffset(java.lang.Object pojo,
                                              long fieldOffset)
Returns true if the field represented by the offset is a portable field, i.e., not static and not dso transient

Parameters:
pojo - Object
fieldOffset - The index
Returns:
true if the field is portable and false otherwise

overridesHashCode

public static boolean overridesHashCode(java.lang.Object obj)

registerNamedLoader

public static void registerNamedLoader(NamedClassLoader loader,
                                       java.lang.String webAppName)
Parameters:
webAppName - if this is a web application loader, the name of the associated web app as it would be declared in a web-application element in the Terracotta config; or null, if this is not a web application loader.

waitForAllCurrentTransactionsToComplete

public static void waitForAllCurrentTransactionsToComplete()


Copyright © 2010 Terracotta, Inc.. All Rights Reserved.