org.jboss.ejb.plugins
Class StatefulSessionInstanceCache

java.lang.Object
  extended byorg.jboss.ejb.plugins.AbstractInstanceCache (src) 
      extended byorg.jboss.ejb.plugins.StatefulSessionInstanceCache
All Implemented Interfaces:
AllowedOperationsFlags (src) , ContainerPlugin (src) , InstanceCache (src) , MetricsConstants (src) , Monitorable (src) , Service (src) , XmlLoadable (src)
Direct Known Subclasses:
StatefulHASessionInstanceCache (src)

public class StatefulSessionInstanceCache
extends AbstractInstanceCache (src)

Cache for stateful session beans.


Field Summary
 
Fields inherited from class org.jboss.ejb.plugins.AbstractInstanceCache (src)
log
 
Fields inherited from interface org.jboss.ejb.AllowedOperationsFlags (src)
IN_AFTER_BEGIN, IN_AFTER_COMPLETION, IN_BEFORE_COMPLETION, IN_BUSINESS_METHOD, IN_EJB_ACTIVATE, IN_EJB_CREATE, IN_EJB_FIND, IN_EJB_HOME, IN_EJB_LOAD, IN_EJB_PASSIVATE, IN_EJB_POST_CREATE, IN_EJB_REMOVE, IN_EJB_STORE, IN_EJB_TIMEOUT, IN_INTERCEPTOR_METHOD, IN_SERVICE_ENDPOINT_METHOD, IN_SET_ENTITY_CONTEXT, IN_SET_MESSAGE_DRIVEN_CONTEXT, IN_SET_SESSION_CONTEXT, IN_UNSET_ENTITY_CONTEXT, NOT_ALLOWED
 
Fields inherited from interface org.jboss.monitor.MetricsConstants (src)
ACTIVITY, APPLICATION, BEAN, BEANCACHE_METRICS, CHECKPOINT, INVOCATION_METRICS, MEMORY_MONITOR, METHOD, PRIMARY_KEY, SYSTEM_METRICS, THREAD_MONITOR, TIME, TYPE
 
Constructor Summary
StatefulSessionInstanceCache()
           
 
Method Summary
protected  EnterpriseContext (src) acquireContext()
          Acquires an EnterpriseContext from the pool
protected  void activate(EnterpriseContext (src)  ctx)
          Activates the given EnterpriseContext
protected  boolean canPassivate(EnterpriseContext (src)  ctx)
          Returns whether the given context can be passivated or not
 void destroy()
          destroy the service, tear down
protected  boolean doActivate(EnterpriseContext (src)  ctx)
          Activate the given EnterpriseContext
protected  void freeContext(EnterpriseContext (src)  ctx)
          Frees the given EnterpriseContext to the pool
protected  Container (src) getContainer()
          Returns the container for this cache.
protected  java.lang.Object getKey(EnterpriseContext (src)  ctx)
          Returns the key used by the cache to map the given context
 long getPassivatedCount()
          Get the passivated count.
protected  void passivate(EnterpriseContext (src)  ctx)
          Passivates the given EnterpriseContext
protected  void postRemovalCleanup(java.lang.Object key)
           
protected  void preRemovalPreparation(java.lang.Object key)
           
protected  void removePassivated(long maxLifeAfterPassivation)
          Remove all passivated instances that have been inactive too long.
 void setContainer(Container (src)  c)
          This callback is set by the container so that the plugin may access it
protected  void setKey(java.lang.Object id, EnterpriseContext (src)  ctx)
          Sets the given id as key for the given context
 
Methods inherited from class org.jboss.ejb.plugins.AbstractInstanceCache (src)
create, flush, get, getCache, getCacheLock, getCachePolicyString, getCacheSize, importXml, insert, isActive, logActivation, logPassivation, release, remove, resetStatistic, retrieveStatistic, sample, start, stop, tryToPassivate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatefulSessionInstanceCache

public StatefulSessionInstanceCache()
Method Detail

getPassivatedCount

public long getPassivatedCount()
Get the passivated count.

Overrides:
getPassivatedCount in class AbstractInstanceCache (src)
Returns:
the number of passivated instances.

setContainer

public void setContainer(Container (src)  c)
Description copied from interface: ContainerPlugin (src)
This callback is set by the container so that the plugin may access it

Parameters:
c - The container using this plugin. This may be null if the plugin is being disassociated from a container.

destroy

public void destroy()
Description copied from interface: Service (src)
destroy the service, tear down

Specified by:
destroy in interface Service (src)
Overrides:
destroy in class AbstractInstanceCache (src)

getContainer

protected Container (src)  getContainer()
Description copied from class: AbstractInstanceCache (src)
Returns the container for this cache.

Specified by:
getContainer in class AbstractInstanceCache (src)

passivate

protected void passivate(EnterpriseContext (src)  ctx)
                  throws java.rmi.RemoteException
Description copied from class: AbstractInstanceCache (src)
Passivates the given EnterpriseContext

Specified by:
passivate in class AbstractInstanceCache (src)
Throws:
java.rmi.RemoteException

activate

protected void activate(EnterpriseContext (src)  ctx)
                 throws java.rmi.RemoteException
Description copied from class: AbstractInstanceCache (src)
Activates the given EnterpriseContext

Specified by:
activate in class AbstractInstanceCache (src)
Throws:
java.rmi.RemoteException

doActivate

protected boolean doActivate(EnterpriseContext (src)  ctx)
                      throws java.rmi.RemoteException
Description copied from class: AbstractInstanceCache (src)
Activate the given EnterpriseContext

Overrides:
doActivate in class AbstractInstanceCache (src)
Parameters:
ctx - the context
Returns:
false if we recursively activating
Throws:
java.rmi.RemoteException - for any error

acquireContext

protected EnterpriseContext (src)  acquireContext()
                                    throws java.lang.Exception
Description copied from class: AbstractInstanceCache (src)
Acquires an EnterpriseContext from the pool

Specified by:
acquireContext in class AbstractInstanceCache (src)
Throws:
java.lang.Exception

freeContext

protected void freeContext(EnterpriseContext (src)  ctx)
Description copied from class: AbstractInstanceCache (src)
Frees the given EnterpriseContext to the pool

Specified by:
freeContext in class AbstractInstanceCache (src)

getKey

protected java.lang.Object getKey(EnterpriseContext (src)  ctx)
Description copied from class: AbstractInstanceCache (src)
Returns the key used by the cache to map the given context

Specified by:
getKey in class AbstractInstanceCache (src)

setKey

protected void setKey(java.lang.Object id,
                      EnterpriseContext (src)  ctx)
Description copied from class: AbstractInstanceCache (src)
Sets the given id as key for the given context

Specified by:
setKey in class AbstractInstanceCache (src)

canPassivate

protected boolean canPassivate(EnterpriseContext (src)  ctx)
Description copied from class: AbstractInstanceCache (src)
Returns whether the given context can be passivated or not

Specified by:
canPassivate in class AbstractInstanceCache (src)

removePassivated

protected void removePassivated(long maxLifeAfterPassivation)
Remove all passivated instances that have been inactive too long.

Parameters:
maxLifeAfterPassivation - the upper bound in milliseconds that an inactive session will be kept.

preRemovalPreparation

protected void preRemovalPreparation(java.lang.Object key)

postRemovalCleanup

protected void postRemovalCleanup(java.lang.Object key)