org.caleigo.core
Class AbstractDataService.AbstractDataTransaction

java.lang.Object
  extended byorg.caleigo.core.AbstractDataService.AbstractDataTransaction
All Implemented Interfaces:
IDataTransaction, IDistributable, java.io.Serializable
Direct Known Subclasses:
CachedDataService.CachedDataTransaction, JDBCDataService.JDBCDataTransaction, JDBCPreparedStatementDataService.JDBCDataTransaction, MemoryDataService.DataTransaction, TunneledDataService.TunneledDataTransaction
Enclosing class:
AbstractDataService

public abstract static class AbstractDataService.AbstractDataTransaction
extends java.lang.Object
implements IDataTransaction, java.io.Serializable

See Also:
Serialized Form

Nested Class Summary
static class AbstractDataService.AbstractDataTransaction.DataOperation
           
 
Nested classes inherited from class org.caleigo.core.IDataTransaction
IDataTransaction.IProgressListener, IDataTransaction.Job, IDataTransaction.ProgressAdapter, IDataTransaction.ProgressEvent
 
Field Summary
protected  IDataTransaction.Job mJob
           
 
Constructor Summary
AbstractDataService.AbstractDataTransaction(int timeout)
           
 
Method Summary
 void addCreate(IEntityDescriptor entityDescriptor)
           
 void addDelete(IEntity entity)
           
 void addLoad(Qualifier identityQualifier, IEntity resultEntity)
           
 void addLoadSelection(DataQuery dataQuery, ISelection resultSelection)
           
 void addLoadSelection(IEntityDescriptor entityDescriptor, Qualifier qualifier, IEntityRelationPath relationPath, ISelection resultSelection)
           
 void addLoadSelection(IEntityDescriptor entityDescriptor, Qualifier qualifier, ISelection resultSelection)
           
protected  void addOperation(AbstractDataService.AbstractDataTransaction.DataOperation op)
           
 void addRefresh(IEntity entity)
           
 void addRelation(IEntityRelation relation)
           
 void addStore(IEntity entity)
           
abstract  void commit()
          Commit performs all the stored operations in the transaction.
 IDataTransaction.Job commitAsynchroniesly(java.lang.Object lock)
          This method creates a Job that when executed will perform the same actions as the commit method.
 int getID()
          Returns a unique id for this data transaction.
protected  IDataTransaction.Job getJob()
           
 int getNbrOfOperations()
           
 java.util.Enumeration getOperations()
           
 boolean isEmpty()
          Help methods that returns true if the transaction is empty, wich means that no operations has been added to it and that commit neads no be called.
 boolean isMutating()
          Help methods that returns true if one or more store or delete methods has been added to the transaction.
protected  void updateProgress(int maxProgress, int currentProgress)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.caleigo.core.IDataTransaction
abortTransaction
 

Field Detail

mJob

protected transient IDataTransaction.Job mJob
Constructor Detail

AbstractDataService.AbstractDataTransaction

public AbstractDataService.AbstractDataTransaction(int timeout)
Method Detail

addLoad

public void addLoad(Qualifier identityQualifier,
                    IEntity resultEntity)
Specified by:
addLoad in interface IDataTransaction

addLoadSelection

public void addLoadSelection(IEntityDescriptor entityDescriptor,
                             Qualifier qualifier,
                             ISelection resultSelection)
Specified by:
addLoadSelection in interface IDataTransaction

addLoadSelection

public void addLoadSelection(IEntityDescriptor entityDescriptor,
                             Qualifier qualifier,
                             IEntityRelationPath relationPath,
                             ISelection resultSelection)
Specified by:
addLoadSelection in interface IDataTransaction

addLoadSelection

public void addLoadSelection(DataQuery dataQuery,
                             ISelection resultSelection)
Specified by:
addLoadSelection in interface IDataTransaction

addStore

public void addStore(IEntity entity)
Specified by:
addStore in interface IDataTransaction

addDelete

public void addDelete(IEntity entity)
Specified by:
addDelete in interface IDataTransaction

addRefresh

public void addRefresh(IEntity entity)
Specified by:
addRefresh in interface IDataTransaction

addCreate

public void addCreate(IEntityDescriptor entityDescriptor)
Specified by:
addCreate in interface IDataTransaction

addRelation

public void addRelation(IEntityRelation relation)
Specified by:
addRelation in interface IDataTransaction

isEmpty

public boolean isEmpty()
Help methods that returns true if the transaction is empty, wich means that no operations has been added to it and that commit neads no be called.

Specified by:
isEmpty in interface IDataTransaction

isMutating

public boolean isMutating()
Help methods that returns true if one or more store or delete methods has been added to the transaction.

Specified by:
isMutating in interface IDataTransaction

commitAsynchroniesly

public IDataTransaction.Job commitAsynchroniesly(java.lang.Object lock)
                                          throws DataServiceException
This method creates a Job that when executed will perform the same actions as the commit method.

Specified by:
commitAsynchroniesly in interface IDataTransaction
Parameters:
lock - when the commit finishes all threads that waits on this object will be notified. This parameter may be null.
Throws:
DataServiceException

commit

public abstract void commit()
                     throws DataServiceException
Commit performs all the stored operations in the transaction. If any of the operations fail a rollback on all operations will be automatically performed and a TransactionFailedException will be thrown.

Specified by:
commit in interface IDataTransaction
Throws:
DataServiceException

getID

public int getID()
Description copied from interface: IDataTransaction
Returns a unique id for this data transaction.

Specified by:
getID in interface IDataTransaction

addOperation

protected void addOperation(AbstractDataService.AbstractDataTransaction.DataOperation op)

updateProgress

protected void updateProgress(int maxProgress,
                              int currentProgress)

getOperations

public java.util.Enumeration getOperations()

getNbrOfOperations

public int getNbrOfOperations()

getJob

protected IDataTransaction.Job getJob()


Copyright © 2005 Caleigo. All Rights Reserved.