org.cruxframework.crux.core.client.db
Class Transaction

java.lang.Object
  extended by org.cruxframework.crux.core.client.db.DBObject
      extended by org.cruxframework.crux.core.client.db.Transaction
Direct Known Subclasses:
IDXTransaction, WSQLTransaction

public abstract class Transaction
extends DBObject

A transaction on Crux Database, To create transactions, use one of Database's getTransaction() method.

Author:
Thiago da Rosa de Bustamante

Nested Class Summary
static class Transaction.Mode
          Transaction mode.
static class Transaction.TransactionCallback
          A callback to monitor the current transaction state changes.
 
Field Summary
protected  Transaction.TransactionCallback transactionCallback
           
 
Fields inherited from class org.cruxframework.crux.core.client.db.DBObject
db, logger
 
Constructor Summary
protected Transaction(AbstractDatabase db, String[] storeNames, Transaction.Mode mode)
           
 
Method Summary
abstract  void abort()
          Abort current transaction and rollback operations.
protected  boolean containsObjectStore(String storeName)
           
abstract  FileStore getFileStore()
          Retrieve a specialized object store for files handling.
 Transaction.Mode getMode()
          Retrieve the trnasction mode
abstract
<K,V> ObjectStore<K,V>
getObjectStore(String storeName)
          Retrieve an ObjectStore manipulated by the current transaction.
 String[] getStoreNames()
          Retrieve the object store names associated with this transaction
 void setTransactionCallback(Transaction.TransactionCallback callback)
          Inform a callback to monitor the current transaction state changes.
 
Methods inherited from class org.cruxframework.crux.core.client.db.DBObject
reportError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transactionCallback

protected Transaction.TransactionCallback transactionCallback
Constructor Detail

Transaction

protected Transaction(AbstractDatabase db,
                      String[] storeNames,
                      Transaction.Mode mode)
Method Detail

getStoreNames

public String[] getStoreNames()
Retrieve the object store names associated with this transaction

Returns:

getMode

public Transaction.Mode getMode()
Retrieve the trnasction mode

Returns:

setTransactionCallback

public void setTransactionCallback(Transaction.TransactionCallback callback)
Inform a callback to monitor the current transaction state changes.

Parameters:
callback -

getObjectStore

public abstract <K,V> ObjectStore<K,V> getObjectStore(String storeName)
Retrieve an ObjectStore manipulated by the current transaction.

Type Parameters:
K -
V -
Parameters:
storeName -
Returns:

abort

public abstract void abort()
Abort current transaction and rollback operations.


getFileStore

public abstract FileStore getFileStore()
Retrieve a specialized object store for files handling.

Returns:

containsObjectStore

protected boolean containsObjectStore(String storeName)
Parameters:
storeName -
Returns:


Copyright © 2014. All rights reserved.