org.jboss.ejb.plugins
Class EntitySynchronizationInterceptor

java.lang.Object
  extended by org.jboss.ejb.plugins.AbstractInterceptor
      extended by org.jboss.ejb.plugins.EntitySynchronizationInterceptor
All Implemented Interfaces:
AllowedOperationsFlags, ContainerPlugin, Interceptor, org.jboss.system.Service
Direct Known Subclasses:
EntityMultiInstanceSynchronizationInterceptor

public class EntitySynchronizationInterceptor
extends AbstractInterceptor

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.

Version:
$Revision: 1.86.2.6 $
Author:
Marc Fleury, Scott Stark, Bill Burke

Nested 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
 
Fields inherited from class org.jboss.ejb.plugins.AbstractInterceptor
log, nextInterceptor
 
Fields inherited from interface org.jboss.ejb.AllowedOperationsFlags
IN_AFTER_BEGIN, IN_AFTER_COMPLETION, IN_BEFORE_COMPLETION, IN_BUSINESS_METHOD, IN_EJB_ACTIVATE, IN_EJB_CREATE, IN_EJB_FIND, IN_EJB_HOME, IN_EJB_LOAD, IN_EJB_PASSIVATE, IN_EJB_POST_CREATE, IN_EJB_REMOVE, IN_EJB_STORE, IN_EJB_TIMEOUT, IN_INTERCEPTOR_METHOD, IN_SERVICE_ENDPOINT_METHOD, IN_SET_ENTITY_CONTEXT, IN_SET_MESSAGE_DRIVEN_CONTEXT, IN_SET_SESSION_CONTEXT, IN_UNSET_ENTITY_CONTEXT, NOT_ALLOWED
 
Constructor Summary
EntitySynchronizationInterceptor()
           
 
Method Summary
 void create()
           
protected  Synchronization createSynchronization(Transaction tx, EntityEnterpriseContext ctx)
           
 Container getContainer()
           
 Object invoke(Invocation mi)
          ???
 Object invokeHome(Invocation mi)
          ???
protected  void register(EntityEnterpriseContext ctx, 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
 void start()
           
 void stop()
           
 
Methods inherited from class org.jboss.ejb.plugins.AbstractInterceptor
destroy, getNext, isAppException, setNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commitOption

protected int commitOption
The current commit option.


optionDRefreshRate

protected long optionDRefreshRate
The refresh rate for commit option d


container

protected EntityContainer container
The container of this interceptor.

Constructor Detail

EntitySynchronizationInterceptor

public EntitySynchronizationInterceptor()
Method Detail

getContainer

public Container getContainer()
Overrides:
getContainer in class AbstractInterceptor

setContainer

public void setContainer(Container container)
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
Overrides:
setContainer in class AbstractInterceptor
Parameters:
container - The container using this plugin. This may be null if the plugin is being disassociated from a container.

create

public void create()
            throws Exception
Specified by:
create in interface org.jboss.system.Service
Overrides:
create in class AbstractInterceptor
Throws:
Exception

start

public void start()
Specified by:
start in interface org.jboss.system.Service
Overrides:
start in class AbstractInterceptor

stop

public void stop()
Specified by:
stop in interface org.jboss.system.Service
Overrides:
stop in class AbstractInterceptor

createSynchronization

protected Synchronization createSynchronization(Transaction tx,
                                                EntityEnterpriseContext ctx)

register

protected void register(EntityEnterpriseContext ctx,
                        Transaction tx)
Register a transaction synchronization callback with a context.


invokeHome

public Object invokeHome(Invocation mi)
                  throws Exception
Description copied from interface: Interceptor
???

Specified by:
invokeHome in interface Interceptor
Overrides:
invokeHome in class AbstractInterceptor
Parameters:
mi - ???
Returns:
???
Throws:
Exception - ???

invoke

public Object invoke(Invocation mi)
              throws Exception
Description copied from interface: Interceptor
???

Specified by:
invoke in interface Interceptor
Overrides:
invoke in class AbstractInterceptor
Parameters:
mi - ???
Returns:
???
Throws:
Exception - ???


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.