|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.model.transaction.impl.TransactionQueue
public class TransactionQueue
Standard implementation of ITransactionQueue
| Constructor Summary | |
|---|---|
TransactionQueue()
Create new transaction queue |
|
| Method Summary | |
|---|---|
void |
abortCurrentTransaction()
Abort the currentTransaction and set currentTransaction to null; |
void |
addTransactionQueueListener(ITransactionQueueListener listener)
Add a new listener for TransactionQueue Events. |
void |
clear()
Clear all transactions from the queue and set currentTransaction to null. |
ITransaction |
getCurrentTransaction(boolean create)
Get the currentTransaction, creating one if null and create flag is true. |
int |
getSize()
Get the number of transaction in the queue |
java.util.List<ITransaction> |
getTransactions()
Get a list containing the transactions in the queue |
void |
push(ITransaction transaction,
boolean saveTransaction)
Push a transaction onto the queue, this will commit the currentTransaction if not null. |
void |
queueCurrentTransaction()
Queue the currentTransaction. |
void |
removeTransactionHandler()
Remove the TransactionQueue handler. |
void |
removeTransactionQueueListener(ITransactionQueueListener listener)
Remove a TransactionQueue listener. |
void |
setTransactionHandler(ITransactionQueueHandler listener)
Set the TransactionQueue Events. |
void |
transactionsCommitted(ITransaction[] transactions,
boolean[] updateResults,
java.util.List<AnzoException>[] errors)
Notify the queue that a set of transactions were committed successfully. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TransactionQueue()
| Method Detail |
|---|
public void setTransactionHandler(ITransactionQueueHandler listener)
ITransactionQueue
setTransactionHandler in interface ITransactionQueuelistener - that handles TransactionQueue eventspublic void removeTransactionHandler()
ITransactionQueue
removeTransactionHandler in interface ITransactionQueuepublic void addTransactionQueueListener(ITransactionQueueListener listener)
ITransactionQueue
addTransactionQueueListener in interface ITransactionQueuelistener - that handles eventspublic void removeTransactionQueueListener(ITransactionQueueListener listener)
ITransactionQueue
removeTransactionQueueListener in interface ITransactionQueuelistener - that handles events
public void clear()
throws AnzoException
ITransactionQueue
clear in interface ITransactionQueueAnzoException - if there was an error clearing the transaction queuepublic void abortCurrentTransaction()
ITransactionQueue
abortCurrentTransaction in interface ITransactionQueuepublic int getSize()
ITransactionQueue
getSize in interface ITransactionQueue
public void push(ITransaction transaction,
boolean saveTransaction)
throws AnzoException
ITransactionQueue
push in interface ITransactionQueuetransaction - Transaction to push onto queue.saveTransaction - Whether this transaction needs to be persisted when added. If loading persisted transactions, they might only
need to added, and not saved.
AnzoExceptionpublic java.util.List<ITransaction> getTransactions()
ITransactionQueue
getTransactions in interface ITransactionQueue
public void queueCurrentTransaction()
throws AnzoException
ITransactionQueue
queueCurrentTransaction in interface ITransactionQueueAnzoException
public ITransaction getCurrentTransaction(boolean create)
throws AnzoException
ITransactionQueue
getCurrentTransaction in interface ITransactionQueuecreate - Whether to create a new transaction if currentTransaction is null.
AnzoException - if there was an error fetching or creating the current transaction
public void transactionsCommitted(ITransaction[] transactions,
boolean[] updateResults,
java.util.List<AnzoException>[] errors)
throws AnzoException
ITransactionQueue
transactionsCommitted in interface ITransactionQueuetransactions - The transaction that were committed.updateResults - Array of booleans signifying if the corresponding transaction was committed successfullyerrors - Array of errors for the corresponding transaction if transaction failed to commit successfully
AnzoException - if there was an error processing the committed transactions
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||