JBoss API: Class EntityInstanceCache
org.jboss.ejb.plugins
Class EntityInstanceCache
java.lang.Object
|
+--org.jboss.ejb.plugins.AbstractInstanceCache
|
+--org.jboss.ejb.plugins.EntityInstanceCache
All Implemented Interfaces: ContainerPlugin , EntityCache , InstanceCache , MetricsConstants , Monitorable , Service , XmlLoadable
public class EntityInstanceCache extends AbstractInstanceCache implements EntityCache
Cache subclass for entity beans.
Version: $Revision: 1.7.2.4 $
Author: Simone Bordet , Bill Burke
Fields inherited from interface org.jboss.monitor.MetricsConstants
ACTIVITY , APPLICATION , BEAN , BEANCACHE_METRICS , CHECKPOINT , INVOCATION_METRICS , MEMORY_MONITOR , METHOD , PRIMARY_KEY , SYSTEM_METRICS , THREAD_MONITOR , TIME , TYPE
Methods inherited from class org.jboss.ejb.plugins.AbstractInstanceCache
getCache , getCacheLock , importXml , init , insert , isActive , isJMSMonitoringEnabled , logActivation , logPassivation , logPassivationPostponed , logPassivationScheduled , release , resetStatistic , retrieveStatistic , sample , schedulePassivation , setJMSMonitoringEnabled , start , stop , unschedulePassivation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
EntityInstanceCache
public EntityInstanceCache ()
setContainer
public void setContainer (Container c)
Description copied from interface: ContainerPlugin
This callback is set by the container so that the plugin may access it
Specified by: setContainer
in interface ContainerPlugin
Following copied from interface: org.jboss.ejb.ContainerPlugin
Parameters: con
- the container using this plugin
createCacheKey
public java.lang.Object createCacheKey (java.lang.Object id)
Description copied from interface: EntityCache
Returns the key used to cache the context
Specified by: createCacheKey
in interface EntityCache
Following copied from interface: org.jboss.ejb.EntityCache
Parameters: id
- Object id / primary keyReturns: Cache key
destroy
public void destroy ()
Specified by: destroy
in interface Service
Overrides: destroy
in class AbstractInstanceCache
get
public EnterpriseContext get (java.lang.Object id)
throws java.rmi.RemoteException,
java.rmi.NoSuchObjectException
Description copied from interface: InstanceCache
Gets a bean instance from this cache given the identity.
This method may involve activation if the instance is not in the cache.
Implementation should have O(1) complexity.
This method is never called for stateless session beans.
Specified by: get
in interface InstanceCache
Overrides: get
in class AbstractInstanceCache
Following copied from interface: org.jboss.ejb.InstanceCache
Parameters: id
- the primary key of the beanReturns: the EnterpriseContext related to the given id Throws: java.rmi.RemoteException
- in case of illegal calls (concurrent / reentrant),
NoSuchObjectException if the bean cannot be found.See Also: InstanceCache.release(org.jboss.ejb.EnterpriseContext)
remove
public void remove (java.lang.Object id)
Description copied from interface: InstanceCache
Removes a bean instance from this cache given the identity.
Implementation should have O(1) complexity and guarantee proper locking.
Specified by: remove
in interface InstanceCache
Overrides: remove
in class AbstractInstanceCache
Following copied from interface: org.jboss.ejb.InstanceCache
Parameters: id
- the pimary key of the beanSee Also: InstanceCache.insert(org.jboss.ejb.EnterpriseContext)
getKey
protected java.lang.Object getKey (EnterpriseContext ctx)
Description copied from class: AbstractInstanceCache
Returns the key used by the cache to map the given context
Overrides: getKey
in class AbstractInstanceCache
setKey
protected void setKey (java.lang.Object id,
EnterpriseContext ctx)
Description copied from class: AbstractInstanceCache
Sets the given id as key for the given context
Overrides: setKey
in class AbstractInstanceCache
getContainer
protected Container getContainer ()
Description copied from class: AbstractInstanceCache
Returns the container for this cache.
Overrides: getContainer
in class AbstractInstanceCache
passivate
protected void passivate (EnterpriseContext ctx)
throws java.rmi.RemoteException
Description copied from class: AbstractInstanceCache
Passivates the given EnterpriseContext
Overrides: passivate
in class AbstractInstanceCache
activate
protected void activate (EnterpriseContext ctx)
throws java.rmi.RemoteException
Description copied from class: AbstractInstanceCache
Activates the given EnterpriseContext
Overrides: activate
in class AbstractInstanceCache
acquireContext
protected EnterpriseContext acquireContext ()
throws java.lang.Exception
Description copied from class: AbstractInstanceCache
Acquires an EnterpriseContext from the pool
Overrides: acquireContext
in class AbstractInstanceCache
freeContext
protected void freeContext (EnterpriseContext ctx)
Description copied from class: AbstractInstanceCache
Frees the given EnterpriseContext to the pool
Overrides: freeContext
in class AbstractInstanceCache
canPassivate
protected boolean canPassivate (EnterpriseContext ctx)
Description copied from class: AbstractInstanceCache
Returns whether the given context can be passivated or not
Overrides: canPassivate
in class AbstractInstanceCache
Copyright © 2000 The JBoss Organization. All Rights Reserved.