|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object i3.dragos.core.services.transactions.localmgr.LocalTransactionManager
public class LocalTransactionManager
A custom TransactionManager implementation. Supports nested transactions as well as transactions distributed across multiple GraphPools.
Field Summary | |
---|---|
static java.lang.String |
IMPLEMENTATION_NAME
This implementation's descriptive name |
Constructor Summary | |
---|---|
LocalTransactionManager(DataSourceURL[] dataSourceURLs)
Creates a new LocalTransactionManager (required constructor for reflection). |
Method Summary | |
---|---|
void |
acquireCommitSemaphore()
Acquires the commit semaphore for this thread. |
Transaction |
createTransaction()
Creates a Transaction object for the specific implementation. |
protected LocalTransaction |
createTransaction0(DataSource[] ds,
LocalTransaction parentTransaction)
Factory method for transactions. |
Transaction |
getCurrentTransaction()
Gets the currently active Transaction , if any. |
java.util.Collection<DataSourceURL> |
getManagedDataSources()
Returns a Collection of DataSourceURLs for all GraphPools managed by this TransactionManager. |
void |
releaseCommitSemaphore()
Releases the commit semaphore for this thread. |
void |
removeTransaction()
Removes a transaction from the map. |
Transaction |
requestTransaction()
Gets the currently active Transaction or initializes a new one if none is currently active. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String IMPLEMENTATION_NAME
Constructor Detail |
---|
public LocalTransactionManager(DataSourceURL[] dataSourceURLs) throws TransactionManagerException
dataSourceURLs
- The URLs of the DataSources to operate on.
TransactionManagerException
- if the supplied array is empty or contains a null
value.Method Detail |
---|
public java.util.Collection<DataSourceURL> getManagedDataSources() throws TransactionException
getManagedDataSources
in interface TransactionManager
TransactionException
- if something goes wrong.public Transaction createTransaction() throws TransactionException
Transaction
object for the specific implementation. If a transaction is already active,
this creates either a nested transaction or throws an exception (if nested transactions are not supported).
createTransaction
in interface TransactionManager
Transaction
instance (never null
).
TransactionException
- if something goes wrong.public Transaction getCurrentTransaction() throws TransactionException
Transaction
, if any.
A transaction is considered the current one if it is not in state Transaction.State.PRECOMMIT
,
Transaction.State.COMMITTED
or Transaction.State.ROLLED_BACK
, and has no active nested
transactions.
getCurrentTransaction
in interface TransactionManager
Transaction
instance or null
if none is active at the moment.
TransactionException
- if something goes wrong.public Transaction requestTransaction() throws TransactionException
Transaction
or initializes a new one if none is currently active.
This convenience method is a simple combination of TransactionManager.getCurrentTransaction()
with an optional
TransactionManager.createTransaction()
.
requestTransaction
in interface TransactionManager
Transaction
instance (never null
).
TransactionException
- if something goes wrong.public void removeTransaction()
public void acquireCommitSemaphore()
public void releaseCommitSemaphore()
protected LocalTransaction createTransaction0(DataSource[] ds, LocalTransaction parentTransaction) throws TransactionException
ds
- DataSource to work with.parentTransaction
- parent transaction if any.
TransactionException
- if the DataSourceTransaction could not be created.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |