goodsjpi
Class OptimisticMetaobject

java.lang.Object
  extended bygoodsjpi.Metaobject
      extended bygoodsjpi.BasicMetaobject
          extended bygoodsjpi.OptimisticMetaobject
All Implemented Interfaces:
java.io.Serializable

public class OptimisticMetaobject
extends BasicMetaobject

Metaobject for optimistic scheme of synchronization. Optimistic means we don't lock. Multiple Readers, multiple Writers would be another way of putting it.

Another way to say this is of course, "You'd better know what you're doing", and then later, "You've been warned".
On the other hand, if you do know that this is no problem, the benefit is that you save the time for the locking (which is a network request in the Pessimistic case)

See Also:
Serialized Form

Field Summary
 
Fields inherited from class goodsjpi.Metaobject
CONSTRUCTOR, EXCEPTION, MUTATOR, VARIABLE
 
Constructor Summary
OptimisticMetaobject()
           
 
Method Summary
 void beginReadAccess(Persistent obj)
          beginReadAccess is a no-op.
 void beginWriteAccess(Persistent obj)
          beginWriteAccess is a no-op.
 void endAccess(Persistent obj)
          endAccess adds the object to the cache managers transaction list if the object has been modified.
 
Methods inherited from class goodsjpi.BasicMetaobject
abortNestedTransaction, abortTransaction, abortTransaction, beginNestedTransaction, commitObjectChanges, commitTransaction, destroyObject, endNestedTransaction, forgetObject, invalidateObject, loadObject, makePersistent, notifyOnModification, postDaemon, preDaemon, preloadObject, releaseObject, sendForgottenObjectsToServers, undoObjectChanges
 
Methods inherited from class goodsjpi.Metaobject
modify, mutator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptimisticMetaobject

public OptimisticMetaobject()
Method Detail

beginWriteAccess

public void beginWriteAccess(Persistent obj)
beginWriteAccess is a no-op. That's why it's optimistic.

Specified by:
beginWriteAccess in class Metaobject
Parameters:
obj - a Persistent object to be modified.

endAccess

public void endAccess(Persistent obj)
endAccess adds the object to the cache managers transaction list if the object has been modified.

Specified by:
endAccess in class Metaobject
Parameters:
obj - a Persistent object that was (or was not) modified.

beginReadAccess

public void beginReadAccess(Persistent obj)
beginReadAccess is a no-op. We're being optimistic, remember.

Specified by:
beginReadAccess in class Metaobject
Parameters:
obj - a Persistent object to be modified.