Package org.cristalise.storage
Class TransactionalClusterStorageBase
java.lang.Object
org.cristalise.kernel.persistency.ClusterStorage
org.cristalise.storage.TransactionalClusterStorageBase
Potentially the base class for ClusterStorage implementation without transactional support, i.e.
XMLClusterStorage and MemoryOnlyClusterStorage.
-
Field Summary
Fields inherited from class org.cristalise.kernel.persistency.ClusterStorage
NONE, READ, READWRITE, WRITE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort(TransactionKey transactionKey) Rolls back all changes sent in the name of 'transactionKey' and unlocks the sysKeysvoidbegin(TransactionKey transactionKey) voidcommit(TransactionKey transactionKey) Writes all pending changes to the backends.voiddelete(ItemPath itemPath, String path, TransactionKey transactionKey) Uses the put method, with null as the object value.voiddumpPendingTransactions(int logLevel) getUncommitted(ItemPath itemPath, String path, TransactionKey transactionKey) Public get method.String[]getUncommittedClusterContents(ItemPath itemPath, String path, TransactionKey transactionKey) Retrieves the ids of the next level of a cluster Checks the transaction table first to see if the caller has uncommitted changesvoidput(ItemPath itemPath, C2KLocalObject obj, TransactionKey transactionKey) Stores a CRISTAL local object.Methods inherited from class org.cristalise.kernel.persistency.ClusterStorage
checkQuerySupport, close, delete, delete, executeQuery, get, getClusterContents, getClusterContents, getClusters, getClusterType, getId, getLastIntegerId, getName, getPath, open, postBoostrap, postConnect, postStartServer, queryClusterSupport, toString
-
Constructor Details
-
TransactionalClusterStorageBase
- Throws:
PersistencyException
-
-
Method Details
-
getUncommittedClusterContents
public String[] getUncommittedClusterContents(ItemPath itemPath, String path, TransactionKey transactionKey) throws PersistencyException Retrieves the ids of the next level of a cluster Checks the transaction table first to see if the caller has uncommitted changes- Parameters:
itemPath- the itempath- the cluster pathtransactionKey- the transaction key- Returns:
- array of ids
- Throws:
PersistencyException
-
getUncommitted
public C2KLocalObject getUncommitted(ItemPath itemPath, String path, TransactionKey transactionKey) throws PersistencyException, ObjectNotFoundException Public get method. Required a 'transactionKey' object for a transaction key. Checks the transaction table first to see if the caller has uncommitted changes -
put
public void put(ItemPath itemPath, C2KLocalObject obj, TransactionKey transactionKey) throws PersistencyException Description copied from class:ClusterStorageStores a CRISTAL local object. The path is automatically generated.- Specified by:
putin classClusterStorage- Parameters:
itemPath- The Item that the object will be stored underobj- The C2KLocalObject to storetransactionKey- the key of the transaction, cannot be null- Throws:
PersistencyException- When storage fails
-
delete
public void delete(ItemPath itemPath, String path, TransactionKey transactionKey) throws PersistencyException Uses the put method, with null as the object value.- Specified by:
deletein classClusterStorage- Parameters:
itemPath- The containing Itempath- The path of the object to be removedtransactionKey- the key of the transaction, cannot be null- Throws:
PersistencyException- When deletion fails or is not allowed
-
begin
- Specified by:
beginin classClusterStorage- Throws:
PersistencyException
-
commit
Writes all pending changes to the backends.- Specified by:
commitin classClusterStorage- Parameters:
transactionKey- transaction transactionKey- Throws:
PersistencyException
-
abort
Rolls back all changes sent in the name of 'transactionKey' and unlocks the sysKeys- Specified by:
abortin classClusterStorage- Parameters:
transactionKey- transaction transactionKey
-
dumpPendingTransactions
public void dumpPendingTransactions(int logLevel)
-