|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jboss.ejb.plugins.EnterpriseInstanceCache
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:
Inner Class Summary | |
protected class |
EnterpriseInstanceCache.PassivationHelper
Helper class that schedules, unschedules, and executes the passivation jobs. |
Constructor Summary | |
EnterpriseInstanceCache()
|
Method Summary | |
protected abstract EnterpriseContext |
acquireContext()
Acquires an EnterpriseContext from the pool |
protected abstract void |
activate(EnterpriseContext ctx)
Activates the given EnterpriseContext |
protected abstract boolean |
canPassivate(EnterpriseContext ctx)
Returns whether the given context can be passivated or not |
void |
destroy()
|
protected abstract void |
freeContext(EnterpriseContext ctx)
Frees the given EnterpriseContext to the pool |
EnterpriseContext |
get(java.lang.Object id)
Gets a bean instance from this cache given the identity. |
protected CachePolicy |
getCache()
Returns the cache policy used for this cache. |
protected java.lang.Object |
getCacheLock()
Returns the mutex used to sync access to the cache policy object |
protected abstract Container |
getContainer()
Returns the container for this cache. |
protected abstract java.lang.Object |
getKey(EnterpriseContext ctx)
Returns the key used by the cache to map the given context |
java.lang.Object |
getLock(java.lang.Object id)
Creates (if necessary) and returns an object used as mutex to sync passivation activity with other activities. |
void |
importXml(org.w3c.dom.Element element)
|
void |
init()
|
void |
insert(EnterpriseContext ctx)
Inserts an active bean instance after creation or activation. |
protected abstract void |
passivate(EnterpriseContext ctx)
Passivates the given EnterpriseContext |
void |
release(EnterpriseContext ctx)
Releases the given bean instance from this cache. |
void |
remove(java.lang.Object id)
Removes a bean instance from this cache given the identity. |
protected void |
removeLock(java.lang.Object id)
Removes the mutex associated with the given id. |
protected void |
schedulePassivation(EnterpriseContext ctx)
Schedules the given EnterpriseContext for passivation |
protected abstract void |
setKey(java.lang.Object id,
EnterpriseContext ctx)
Sets the given id as key for the given context |
void |
start()
|
void |
stop()
|
protected EnterpriseContext |
unschedulePassivation(java.lang.Object id)
Tries to unschedule the given EnterpriseContext for passivation; returns the unscheduled context if it wasn't passivated yet, null if the passivation already happened. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.ejb.ContainerPlugin |
setContainer |
Constructor Detail |
public EnterpriseInstanceCache()
Method Detail |
public EnterpriseContext get(java.lang.Object id) throws java.rmi.RemoteException, java.rmi.NoSuchObjectException
InstanceCache
get
in interface InstanceCache
org.jboss.ejb.InstanceCache
id
- the primary key of the beanjava.rmi.RemoteException
- in case of illegal calls (concurrent / reentrant),
NoSuchObjectException if the bean cannot be found.InstanceCache.release(org.jboss.ejb.EnterpriseContext)
public void insert(EnterpriseContext ctx)
InstanceCache
insert
in interface InstanceCache
org.jboss.ejb.InstanceCache
ctx
- the EnterpriseContext to insert in the cacheInstanceCache.remove(java.lang.Object)
public void release(EnterpriseContext ctx)
InstanceCache
release
in interface InstanceCache
org.jboss.ejb.InstanceCache
ctx
- the EnterpriseContext to releaseInstanceCache.get(java.lang.Object)
public void remove(java.lang.Object id)
InstanceCache
remove
in interface InstanceCache
org.jboss.ejb.InstanceCache
id
- the pimary key of the beanInstanceCache.insert(org.jboss.ejb.EnterpriseContext)
public java.lang.Object getLock(java.lang.Object id)
protected void removeLock(java.lang.Object id)
public void importXml(org.w3c.dom.Element element) throws DeploymentException
importXml
in interface XmlLoadable
public void init() throws java.lang.Exception
init
in interface Service
public void start() throws java.lang.Exception
start
in interface Service
public void stop()
stop
in interface Service
public void destroy()
destroy
in interface Service
protected void schedulePassivation(EnterpriseContext ctx)
EnterpriseInstanceCache.PassivationHelper.schedule(org.jboss.ejb.EnterpriseContext)
protected EnterpriseContext unschedulePassivation(java.lang.Object id)
EnterpriseInstanceCache.PassivationHelper.unschedule(java.lang.Object)
protected abstract Container getContainer()
protected CachePolicy getCache()
protected java.lang.Object getCacheLock()
protected abstract void passivate(EnterpriseContext ctx) throws java.rmi.RemoteException
protected abstract void activate(EnterpriseContext ctx) throws java.rmi.RemoteException
protected abstract EnterpriseContext acquireContext() throws java.lang.Exception
protected abstract void freeContext(EnterpriseContext ctx)
protected abstract java.lang.Object getKey(EnterpriseContext ctx)
protected abstract void setKey(java.lang.Object id, EnterpriseContext ctx)
protected abstract boolean canPassivate(EnterpriseContext ctx)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |