|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ejb.plugins.PerTxEntityInstanceCache
Per transaction instance cache.
Field Summary |
Constructor Summary | |
PerTxEntityInstanceCache()
|
Method Summary | |
protected boolean |
canPassivate(EnterpriseContext (src) ctx)
|
void |
create()
create the service, do expensive operations etc |
java.lang.Object |
createCacheKey(java.lang.Object id)
Returns the key used to cache the context |
void |
destroy()
destroy the service, tear down |
void |
flush()
Flush the cache. |
EnterpriseContext (src) |
get(java.lang.Object id)
Gets a bean instance from this cache given the identity. |
long |
getCacheSize()
Get the current cache size |
void |
insert(EnterpriseContext (src) instance)
Inserts an active bean instance after creation or activation. |
boolean |
isActive(java.lang.Object id)
Checks whether an instance corresponding to a particular id is active. |
void |
release(EnterpriseContext (src) instance)
Releases the given bean instance from this cache. |
void |
remove(java.lang.Object id)
Removes a bean instance from this cache given the identity. |
void |
setContainer(Container (src) con)
This callback is set by the container so that the plugin may access it |
void |
start()
start the service, create is already called |
void |
stop()
stop the service |
protected void |
tryToPassivate(EnterpriseContext (src) instance)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PerTxEntityInstanceCache()
Method Detail |
public java.lang.Object createCacheKey(java.lang.Object id)
EntityCache (src)
createCacheKey
in interface EntityCache (src)
id
- Object id / primary key
public EnterpriseContext (src) get(java.lang.Object id) throws java.rmi.RemoteException, java.rmi.NoSuchObjectException
InstanceCache (src)
Implementation should have O(1) complexity.
This method is never called for stateless session beans.
get
in interface InstanceCache (src)
id
- The primary key of the bean .
java.rmi.NoSuchObjectException
- if the bean cannot be found.
java.rmi.RemoteException
- In case of illegal calls (concurrent /
reentrant)InstanceCache.release(org.jboss.ejb.EnterpriseContext)
public void insert(EnterpriseContext (src) instance)
InstanceCache (src)
Implementation should guarantee proper locking and O(1) complexity.
insert
in interface InstanceCache (src)
instance
- The EnterpriseContext to insert in the cacheInstanceCache.remove(java.lang.Object)
public void release(EnterpriseContext (src) instance)
InstanceCache (src)
release
in interface InstanceCache (src)
instance
- The EnterpriseContext to releaseInstanceCache.get(java.lang.Object)
public void remove(java.lang.Object id)
InstanceCache (src)
remove
in interface InstanceCache (src)
id
- The pimary key of the bean.InstanceCache.insert(org.jboss.ejb.EnterpriseContext)
public boolean isActive(java.lang.Object id)
InstanceCache (src)
isActive
in interface InstanceCache (src)
id
- The pimary key of the bean.InstanceCache.insert(org.jboss.ejb.EnterpriseContext)
public long getCacheSize()
InstanceCache (src)
getCacheSize
in interface InstanceCache (src)
public void flush()
InstanceCache (src)
flush
in interface InstanceCache (src)
public void setContainer(Container (src) con)
ContainerPlugin (src)
setContainer
in interface ContainerPlugin (src)
con
- The container using this plugin. This may be null if the
plugin is being disassociated from a container.public void create() throws java.lang.Exception
Service (src)
create
in interface Service (src)
java.lang.Exception
public void start() throws java.lang.Exception
Service (src)
start
in interface Service (src)
java.lang.Exception
public void stop()
Service (src)
stop
in interface Service (src)
public void destroy()
Service (src)
destroy
in interface Service (src)
protected void tryToPassivate(EnterpriseContext (src) instance)
protected boolean canPassivate(EnterpriseContext (src) ctx)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |