|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jboss.ejb.plugins.AbstractInterceptor | +--org.jboss.ejb.plugins.EntitySynchronizationInterceptor
The role of this interceptor is to synchronize the state of the cache with the underlying storage. It does this with the ejbLoad and ejbStore semantics of the EJB specification. In the presence of a transaction this is triggered by transaction demarcation. It registers a callback with the underlying transaction monitor through the JTA interfaces. If there is no transaction the policy is to store state upon returning from invocation. The synchronization polices A,B,C of the specification are taken care of here.
WARNING: critical code, get approval from senior developers before changing.
Revisions:
2001/06/28: marcf
2001/07/12: starksm
2001/07/26: billb
2001/08/01: marcf
2001/08/02: marcf
2001/08/07: billb
2001/10/11: billb
2001/10/18: billb
Inner Class Summary | |
protected class |
EntitySynchronizationInterceptor.InstanceSynchronization
|
Field Summary | |
protected int |
commitOption
The current commit option. |
protected EntityContainer |
container
The container of this interceptor. |
protected long |
optionDRefreshRate
The refresh rate for commit option d |
protected java.util.HashSet |
validContexts
For commit option D this is the cache of valid entities |
Fields inherited from class org.jboss.ejb.plugins.AbstractInterceptor |
log, nextInterceptor |
Constructor Summary | |
EntitySynchronizationInterceptor()
|
Method Summary | |
protected void |
clearContextTx(java.lang.String msg,
EntityEnterpriseContext ctx,
javax.transaction.Transaction tx,
boolean trace)
|
protected javax.transaction.Synchronization |
createSynchronization(javax.transaction.Transaction tx,
EntityEnterpriseContext ctx)
|
Container |
getContainer()
|
void |
init()
|
java.lang.Object |
invoke(MethodInvocation mi)
|
java.lang.Object |
invokeHome(MethodInvocation mi)
|
protected void |
register(EntityEnterpriseContext ctx,
javax.transaction.Transaction tx)
Register a transaction synchronization callback with a context. |
void |
setContainer(Container container)
This callback is set by the container so that the plugin may access it |
Methods inherited from class org.jboss.ejb.plugins.AbstractInterceptor |
destroy, getNext, setNext, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int commitOption
protected long optionDRefreshRate
protected EntityContainer container
protected java.util.HashSet validContexts
Constructor Detail |
public EntitySynchronizationInterceptor()
Method Detail |
public void setContainer(Container container)
ContainerPlugin
setContainer
in class AbstractInterceptor
org.jboss.ejb.ContainerPlugin
con
- the container using this pluginpublic void init() throws java.lang.Exception
init
in class AbstractInterceptor
public Container getContainer()
getContainer
in class AbstractInterceptor
protected javax.transaction.Synchronization createSynchronization(javax.transaction.Transaction tx, EntityEnterpriseContext ctx)
protected void register(EntityEnterpriseContext ctx, javax.transaction.Transaction tx)
public java.lang.Object invokeHome(MethodInvocation mi) throws java.lang.Exception
invokeHome
in class AbstractInterceptor
public java.lang.Object invoke(MethodInvocation mi) throws java.lang.Exception
invoke
in class AbstractInterceptor
protected void clearContextTx(java.lang.String msg, EntityEnterpriseContext ctx, javax.transaction.Transaction tx, boolean trace)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |