Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » ejb » plugins » [javadoc | source]
org.jboss.ejb.plugins
abstract public class: AbstractInstanceCache [javadoc | source]
java.lang.Object
   org.jboss.ejb.plugins.AbstractInstanceCache

All Implemented Interfaces:
    MetricsConstants, XmlLoadable, AbstractInstanceCacheMBean, Monitorable, InstanceCache

Direct Known Subclasses:
    StatefulSessionInstanceCache, ClusterSyncEntityInstanceCache, InvalidableEntityInstanceCache, StatefulHASessionInstanceCache, EntityInstanceCache

Base class for caches of entity and stateful beans.

It manages the cache entries through a CachePolicy object; the implementation of the cache policy object must respect the following requirements:

Field Summary
protected static  Logger log     
Method from org.jboss.ejb.plugins.AbstractInstanceCache Summary:
acquireContext,   activate,   canPassivate,   create,   destroy,   doActivate,   flush,   freeContext,   get,   getCache,   getCacheLock,   getCachePolicyString,   getCacheSize,   getContainer,   getKey,   getPassivatedCount,   importXml,   insert,   isActive,   logActivation,   logPassivation,   passivate,   release,   remove,   resetStatistic,   retrieveStatistic,   sample,   setKey,   start,   stop,   tryToPassivate,   tryToPassivate,   unableToPassivateDueToCtxLock
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.ejb.plugins.AbstractInstanceCache Detail:
 abstract protected EnterpriseContext acquireContext() throws Exception
    Acquires an EnterpriseContext from the pool
 abstract protected  void activate(EnterpriseContext ctx) throws RemoteException
    Activates the given EnterpriseContext
 abstract protected boolean canPassivate(EnterpriseContext ctx)
    Returns whether the given context can be passivated or not
 public  void create() throws Exception 
 public  void destroy() 
 protected boolean doActivate(EnterpriseContext ctx) throws RemoteException 
    Activate the given EnterpriseContext
 public  void flush() 
    Flush the cache.
 abstract protected  void freeContext(EnterpriseContext ctx)
    Frees the given EnterpriseContext to the pool
 public EnterpriseContext get(Object id) throws NoSuchObjectException, RemoteException 
 protected CachePolicy getCache() 
    Returns the cache policy used for this cache.
 public Object getCacheLock() 
    Returns the mutex used to sync access to the cache policy object
 public String getCachePolicyString() 
    Display the cache policy.
 public long getCacheSize() 
    Get the current cache size
 abstract protected Container getContainer()
    Returns the container for this cache.
 abstract protected Object getKey(EnterpriseContext ctx)
    Returns the key used by the cache to map the given context
 public long getPassivatedCount() 
    Get the passivated count.
 public  void importXml(Element element) throws DeploymentException 
 public  void insert(EnterpriseContext ctx) 
 public boolean isActive(Object id) 
 protected  void logActivation(Object id) 
 protected  void logPassivation(Object id) 
 abstract protected  void passivate(EnterpriseContext ctx) throws RemoteException
    Passivates the given EnterpriseContext
 public  void release(EnterpriseContext ctx) 
    Passivates and removes the instance from the cache. If the instance is in use then removal and passivation will be scheduled until after transaction ends
 public  void remove(Object id) 
    From InstanceCache interface
 public  void resetStatistic() 
 public Map retrieveStatistic() 
 public  void sample(Object s) 
 abstract protected  void setKey(Object id,
    EnterpriseContext ctx)
    Sets the given id as key for the given context
 public  void start() throws Exception 
 public  void stop() 
 protected  void tryToPassivate(EnterpriseContext ctx) 
    Tries to passivate the instance. If the instance is in use then the instance will be passivated later according to the container's commit option and max age.
 protected  void tryToPassivate(EnterpriseContext ctx,
    boolean passivateAfterCommit) 
    Tries to passivate the instance. If the instance is in use and passivateAfterCommit parameter is true then the instance will passivated after the transaction commits. Otherwise, the instance will be passivated later according to the container's commit option and max age.
 protected  void unableToPassivateDueToCtxLock(EnterpriseContext ctx,
    boolean passivateAfterCommit)