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.37.2.4 $
Revisions:
2001/06/28: marcf
Moved to new synchronization
afterCompletion doesn't return to pool anymore, idea is to simplify
design by not mucking with reuse of the instances
before completion checks for a rolledback tx and doesn't call the
store in case of a rollback we are notified but we don't register
the resource
2001/07/12: starksm
Fixed invalid use of the ctx.transaction in beforeCompletion
Added clearContextTx to make sure clean up of ctx.tx was done consistently
Clean up the EntityContainer cast-fest
2001/07/26: billb
Locking is now separate from EntityEnterpriseContext objects and is now
encapsulated in BeanLock and BeanLockManager. Did this because the lifetime
of an EntityLock is sometimes longer than the lifetime of the ctx.
2001/08/01: marcf
Updated BeanLock to work in new interceptor and out of InstanceInterceptor so we update
here as well to use the new interceptor lock logic and the BeanLock that bill introduced
Make use of clearContextTx in all exceptional cases
2001/08/02: marcf
Moved policy to pluggable framework. Work through the interface of the lock only
Use of "endTransaction" and "wontSynchronize" to communicate with the lock
2001/08/07: billb
Moved storeEntity to EntityContainer.
invokeHome is now scheduled
made InstanceSynchronization protected so that I could inherit from it
made a protected method createSynchronization for inheritance purposes.
2001/10/11: billb
do not call cache.release if entity has been removed