org.nakedobjects.remoting.client.transaction
Class ClientSideTransaction

java.lang.Object
  extended by org.nakedobjects.runtime.transaction.NakedObjectTransactionAbstract
      extended by org.nakedobjects.remoting.client.transaction.ClientSideTransaction
All Implemented Interfaces:
Component, TransactionScopedComponent, NakedObjectTransaction

public class ClientSideTransaction
extends NakedObjectTransactionAbstract

Encapsulates a transaction occurring on the client, where each of the actions (add, remove and change) are then passed to the server as an atomic unit.

Each action is captured as an ClientTransactionEvent object.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nakedobjects.runtime.transaction.NakedObjectTransaction
NakedObjectTransaction.State
 
Constructor Summary
ClientSideTransaction(NakedObjectTransactionManager transactionManager, MessageBroker messageBroker, UpdateNotifier updateNotifier)
           
 
Method Summary
 void addDestroyObject(NakedObject object)
          Add an event to transaction for the destruction of the specified object.
 void addMakePersistent(NakedObject object)
          Add an event to transaction for the adding of the specified object.
 void addObjectChanged(NakedObject object)
          Add an event to transaction for the updating of the specified object.
 void doAbort()
          TODO: need to restore the state of all involved objects
protected  void doFlush()
           
 ClientTransactionEvent[] getEntries()
          Return all the events for the transaction.
 boolean isEmpty()
          Returns true if there are no entries, hence the transaction is not used.
 
Methods inherited from class org.nakedobjects.runtime.transaction.NakedObjectTransactionAbstract
abort, appendTo, commit, flush, getAbortCause, getMessageBroker, getState, getTransactionManager, getUpdateNotifier, setAbortCause, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientSideTransaction

public ClientSideTransaction(NakedObjectTransactionManager transactionManager,
                             MessageBroker messageBroker,
                             UpdateNotifier updateNotifier)
Method Detail

addMakePersistent

public void addMakePersistent(NakedObject object)
Add an event to transaction for the adding of the specified object.


addObjectChanged

public void addObjectChanged(NakedObject object)
Add an event to transaction for the updating of the specified object.


addDestroyObject

public void addDestroyObject(NakedObject object)
Add an event to transaction for the destruction of the specified object.


getEntries

public ClientTransactionEvent[] getEntries()
Return all the events for the transaction.


isEmpty

public boolean isEmpty()
Returns true if there are no entries, hence the transaction is not used.


doFlush

protected void doFlush()
Specified by:
doFlush in class NakedObjectTransactionAbstract

doAbort

public void doAbort()
TODO: need to restore the state of all involved objects

Specified by:
doAbort in class NakedObjectTransactionAbstract


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.