com.tc.object.bytecode
Interface Manager

All Superinterfaces:
TerracottaLocking
All Known Implementing Classes:
NullManager

public interface Manager
extends TerracottaLocking

The Manager interface


Field Summary
static java.lang.String CLASS
          This class's class path: com/tc/object/bytecode/Manager
static int LOCK_TYPE_CONCURRENT
           
static int LOCK_TYPE_READ
           
static int LOCK_TYPE_SYNCHRONOUS_WRITE
           
static int LOCK_TYPE_WRITE
           
static java.lang.String TYPE
          Bytecode type definition for this class
 
Method Summary
 int calculateDsoHashCode(java.lang.Object obj)
          Calculate a hash code for the object that will be the same on all nodes, i.e., that does not depend on Object.hashCode().
 void checkWriteAccess(java.lang.Object context)
          Check whether current context has write access
 java.lang.Object createOrReplaceRoot(java.lang.String rootName, java.lang.Object object)
          Create or replace root, typically used for replaceable roots.
 boolean distributedMethodCall(java.lang.Object receiver, java.lang.String method, java.lang.Object[] params, boolean runOnAllNodes)
          Perform distributed method call
 void distributedMethodCallCommit()
          Commit DMI call
 java.lang.Object getChangeApplicator(java.lang.Class clazz)
          Retrieve the customer change applicator that was registered for a particular class.
 ClassProvider getClassProvider()
          Get the ClassProvider associated with this Manager
 java.lang.String getClientID()
          Get JVM Client identifier
 DsoCluster getDsoCluster()
          Retrieves the DSO cluster instance.
 InstrumentationLogger getInstrumentationLogger()
          Get the instrumentation logger
 TCLogger getLogger(java.lang.String loggerName)
          Get the named logger
 javax.management.MBeanServer getMBeanServer()
          Retrieves the MBean server that's used by this Terracotta client
 SessionConfiguration getSessionConfiguration(java.lang.String appName)
          Get the configuration for the given application name (ie.
 StatisticRetrievalAction getStatisticRetrievalActionInstance(java.lang.String name)
           
 TCProperties getTCProperties()
           
 TunneledDomainUpdater getTunneledDomainUpdater()
          Get the TunneledDomainUpdater associated with this Manager
 java.lang.String getUUID()
          Get unique Client identifier
 void init()
          Initialize the Manager
 void initForTests()
          Initialize the Manager for running tests
 boolean isDsoMonitored(java.lang.Object obj)
          Check whether an object is shared
 boolean isDsoMonitorEntered(java.lang.Object obj)
          Check whether dso MonitorExist is required
 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
 boolean isLiteralAutolock(java.lang.Object o)
           
 boolean isLiteralInstance(java.lang.Object obj)
           
 boolean isLogical(java.lang.Object object)
          Check whether object is logically instrumented
 boolean isManaged(java.lang.Object object)
          Check whether an object is managed
 boolean isPhysicallyInstrumented(java.lang.Class clazz)
          Determine whether this class is physically instrumented
 boolean isRoot(java.lang.reflect.Field field)
          Check whether field is a root
 void logicalInvoke(java.lang.Object object, java.lang.String methodName, java.lang.Object[] params)
          Perform invoke on logical managed object
 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
 TCObjectExternal lookupExistingOrNull(java.lang.Object obj)
          Find managed object, which may be null
 java.lang.Object lookupObject(ObjectID id)
          Look up object by ID, faulting into the JVM if necessary
 java.lang.Object lookupObject(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.
 TCObjectExternal lookupOrCreate(java.lang.Object obj)
          Find or create new TCObjectExternal
 java.lang.Object lookupOrCreateRoot(java.lang.String name, java.lang.Object object)
          Look up or create a new root object
 java.lang.Object lookupOrCreateRootNoDepth(java.lang.String name, java.lang.Object obj)
          Look up or create a new root object.
 java.lang.Object lookupRoot(java.lang.String name)
          Lookup root by name
 void monitorEnter(LockID lock, LockLevel level)
          Used by instrumented code to perform a clustered monitorenter.
 void monitorExit(LockID lock, LockLevel level)
          Used by instrumented code to perform a clustered monitorexit.
 boolean overridesHashCode(java.lang.Object obj)
          Returns true if the given object overrides hashCode() from java.lang.Object.
 void preFetchObject(ObjectID id)
          Prefetch object by ID, faulting into the JVM if necessary, Async lookup and will not cause ObjectNotFoundException like lookupObject.
 void registerBeforeShutdownHook(java.lang.Runnable beforeShutdownHook)
          Registers a hook that will be called before shutting down this client
 void registerNamedLoader(NamedClassLoader loader, java.lang.String webAppName)
          Register a named classloader with Terracotta.
 void registerStatisticRetrievalAction(StatisticRetrievalAction sra)
           
 void stop()
          Stop the manager
 void waitForAllCurrentTransactionsToComplete()
          Used by BulkLoad to wait for all current transactions completed
 
Methods inherited from interface com.tc.object.locks.TerracottaLocking
generateLockIdentifier, generateLockIdentifier, generateLockIdentifier, globalHoldCount, globalPendingCount, globalWaitingCount, isLocked, isLockedByCurrentThread, isLockedByCurrentThread, localHoldCount, lock, lockInterruptibly, notify, notifyAll, pinLock, tryLock, tryLock, unlock, unpinLock, wait, wait
 

Field Detail

CLASS

static final java.lang.String CLASS
This class's class path: com/tc/object/bytecode/Manager

See Also:
Constant Field Values

TYPE

static final java.lang.String TYPE
Bytecode type definition for this class

See Also:
Constant Field Values

LOCK_TYPE_READ

static final int LOCK_TYPE_READ
See Also:
Constant Field Values

LOCK_TYPE_WRITE

static final int LOCK_TYPE_WRITE
See Also:
Constant Field Values

LOCK_TYPE_CONCURRENT

static final int LOCK_TYPE_CONCURRENT
See Also:
Constant Field Values

LOCK_TYPE_SYNCHRONOUS_WRITE

static final int LOCK_TYPE_SYNCHRONOUS_WRITE
See Also:
Constant Field Values
Method Detail

isPhysicallyInstrumented

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

Parameters:
clazz - Class
Returns:
True if physically instrumented

init

void init()
Initialize the Manager


initForTests

void initForTests()
Initialize the Manager for running tests


stop

void stop()
Stop the manager


lookupOrCreateRoot

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

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

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

lookupObject

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

Parameters:
id - Object identifier
Returns:
The actual object
Throws:
java.lang.ClassNotFoundException

preFetchObject

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

lookupObject

java.lang.Object lookupObject(ObjectID id,
                              ObjectID parentContext)
                              throws java.lang.ClassNotFoundException
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
java.lang.ClassNotFoundException

lookupExistingOrNull

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

Parameters:
obj - The object instance
Returns:
The TCObject

lookupOrCreate

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

Parameters:
obj - The object instance
Returns:
The TCObjectExternal

logicalInvoke

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

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

distributedMethodCall

boolean distributedMethodCall(java.lang.Object receiver,
                              java.lang.String method,
                              java.lang.Object[] params,
                              boolean runOnAllNodes)
Perform distributed method call

Parameters:
receiver - The receiver object
method - The method to call
params - The parameter values
runOnAllNodes - True if should run on all nodes, false just for this node

distributedMethodCallCommit

void distributedMethodCallCommit()
Commit DMI call


lookupRoot

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

Parameters:
name - Name of root
Returns:
Root object

checkWriteAccess

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

calculateDsoHashCode

int calculateDsoHashCode(java.lang.Object obj)
Calculate a hash code for the object that will be the same on all nodes, i.e., that does not depend on Object.hashCode(). For objects that override hashCode(), the object's hashCode() will be used; for literals that use Object.hashCode(), like Class, a stable hash code will be computed. Note that for objects that override hashCode() but that still base the result on Object.hashCode() the result of this method may still be unstable.


isLiteralInstance

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

isManaged

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

Parameters:
object - Instance
Returns:
True if managed

isLiteralAutolock

boolean isLiteralAutolock(java.lang.Object o)
Returns:
true if obj is an instance of a literal type and is suitable for cluster-wide locking,

isDsoMonitored

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

Parameters:
obj - Instance
Returns:
True if shared

isDsoMonitorEntered

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

Returns:
True if required

getChangeApplicator

java.lang.Object getChangeApplicator(java.lang.Class clazz)
Retrieve the customer change applicator that was registered for a particular class.

Parameters:
clazz - The class for which the custom change application has to be returned
Returns:
the instance of the custom change applicator; or null if no custom applicator was registered for this class

isLogical

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

Parameters:
object - Instance
Returns:
True if logically instrumented

isRoot

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

Parameters:
field - Field
Returns:
True if root

getClientID

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

Returns:
Client identifier

getUUID

java.lang.String getUUID()
Get unique Client identifier

Returns:
unique Client identifier

getLogger

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

Parameters:
loggerName - Logger name
Returns:
The logger

getInstrumentationLogger

InstrumentationLogger getInstrumentationLogger()
Get the instrumentation logger


getTCProperties

TCProperties getTCProperties()
Returns:
TCProperties

isFieldPortableByOffset

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

boolean overridesHashCode(java.lang.Object obj)
Returns true if the given object overrides hashCode() from java.lang.Object. Enum types are NOT considered to override hashCode()


registerNamedLoader

void registerNamedLoader(NamedClassLoader loader,
                         java.lang.String webAppName)
Register a named classloader with Terracotta.

Parameters:
webAppName - corresponds to the name of a web-application in the TC config, or null if the classloader being registered is not associated with a web application.

getClassProvider

ClassProvider getClassProvider()
Get the ClassProvider associated with this Manager


getTunneledDomainUpdater

TunneledDomainUpdater getTunneledDomainUpdater()
Get the TunneledDomainUpdater associated with this Manager


getDsoCluster

DsoCluster getDsoCluster()
Retrieves the DSO cluster instance.

Returns:
the DSO cluster instance for this manager

getMBeanServer

javax.management.MBeanServer getMBeanServer()
Retrieves the MBean server that's used by this Terracotta client

Returns:
the MBean server for this client

getStatisticRetrievalActionInstance

StatisticRetrievalAction getStatisticRetrievalActionInstance(java.lang.String name)

registerStatisticRetrievalAction

void registerStatisticRetrievalAction(StatisticRetrievalAction sra)

monitorEnter

void monitorEnter(LockID lock,
                  LockLevel level)
Used by instrumented code to perform a clustered monitorenter.


monitorExit

void monitorExit(LockID lock,
                 LockLevel level)
Used by instrumented code to perform a clustered monitorexit.

Implementations of this method should prevent propagation of all Throwable instances. Instead Throwable instances are logged and the client VM is then terminated. If you don't want this behavior then don't call this method.

This behavior is there to ensure that exceptions thrown during transaction commit or clustered unlocking do not cause the thread to enter an infinite loop.

See Also:
DEV-113

getSessionConfiguration

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

waitForAllCurrentTransactionsToComplete

void waitForAllCurrentTransactionsToComplete()
Used by BulkLoad to wait for all current transactions completed


registerBeforeShutdownHook

void registerBeforeShutdownHook(java.lang.Runnable beforeShutdownHook)
Registers a hook that will be called before shutting down this client



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