public enum ActiveTransactionRegistry extends Enum<ActiveTransactionRegistry>
UUID
and the RepositoryConnection
that corresponds to the given
transaction.Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
deregister(UUID transactionId)
Remove the given transaction from the registry
|
RepositoryConnection |
getTransactionConnection(UUID transactionId)
Obtain the
RepositoryConnection associated with the given
transaction. |
void |
register(UUID transactionId,
RepositoryConnection conn)
Register a new transaction with the given id and connection.
|
void |
returnTransactionConnection(UUID transactionId)
Unlocks the
RepositoryConnection associated with the given
transaction for use by other threads. |
static ActiveTransactionRegistry |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ActiveTransactionRegistry[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ActiveTransactionRegistry INSTANCE
public static ActiveTransactionRegistry[] values()
for (ActiveTransactionRegistry c : ActiveTransactionRegistry.values()) System.out.println(c);
public static ActiveTransactionRegistry valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic void register(UUID transactionId, RepositoryConnection conn) throws RepositoryException
transactionId
- the transaction idconn
- the RepositoryConnection
to use for handling the
transaction.RepositoryException
- if a transaction is already registered with the given transaction
id.public void deregister(UUID transactionId) throws RepositoryException
transactionId
- the transaction idRepositoryException
- if no registered transaction with the given id could be found.public RepositoryConnection getTransactionConnection(UUID transactionId) throws RepositoryException, InterruptedException
RepositoryConnection
associated with the given
transaction. This method will block if another thread currently has access
to the connection.transactionId
- a transaction IDRepositoryException
- if no transaction with the given id is registered.InterruptedException
- if the thread is interrupted while acquiring a lock on the
transaction.public void returnTransactionConnection(UUID transactionId)
RepositoryConnection
associated with the given
transaction for use by other threads. If the transaction is no longer
registered, this will method will exit silently.transactionId
- a transaction identifier.Copyright © 2001-2016 Aduna. All Rights Reserved.