public final class TransactionTableUpdater extends java.lang.Object implements TransactionListener
transaction listener
implementation
which receives notifications of transaction events and updates the metadata
transaction table accordingly. This involves the creation, lookup, and deletion of metadata
transaction records. Currently, this work is done inline. If this becomes too expensive, it
will need to be offloaded to a worker thread).Modifier and Type | Class and Description |
---|---|
private static class |
TransactionTableUpdater.Handler
Invocation handler which delegates calls to the
TransactionTableUpdater.MinimalTrans proxy methods to the
backing DMO instance. |
static interface |
TransactionTableUpdater.MinimalTrans
Interface which defines the minimally required methods of the
MetaTrans
interface. |
Modifier and Type | Field and Description |
---|---|
private static java.lang.Class<?> |
dmoClass
MetaTransImpl DMO implementation class
|
private TransactionTableUpdater.Handler |
handler
Invocation handler which maps proxy method calls to underlying DMO methods
|
private static java.lang.String |
HQL_TRANS
HQL query to find a trans record by transaction ID
|
private java.lang.Object |
lock
Object on which updates are synchronized
|
private static java.util.logging.Logger |
log
Logger
|
private static java.util.Map<java.lang.reflect.Method,java.lang.reflect.Method> |
methodMap
Map of
MinimalTrans methods to MetaTransImpl methods |
private static int |
nextTransNum
Next available transaction number
|
private Persistence |
persistence
Persistence helper object for metadata database
|
private TransactionTableUpdater.MinimalTrans |
proxy
Proxy object for the current metadata transaction DMO
|
private SecurityManager |
securityManager
Security manager
|
private static java.lang.String |
TRANS_TABLE
Metadata transaction table name
|
private static org.hibernate.type.Type[] |
TYPES_TRANS
Parameter types for transaction record query
|
Constructor and Description |
---|
TransactionTableUpdater(Database metaDB)
Constructor which stores a persistence object for the associated metadata database, and
initializes a proxy for the application-specific DMO.
|
Modifier and Type | Method and Description |
---|---|
void |
transactionEnded(int64 transID)
Remove the trans record with the given ID from the metadata database, in response to a
transaction event.
|
void |
transactionStarted(int64 transID)
Create a new trans record in the metadata database, in response to a transaction event.
|
private static final java.util.logging.Logger log
private static final java.lang.String TRANS_TABLE
private static final java.lang.String HQL_TRANS
private static final org.hibernate.type.Type[] TYPES_TRANS
private static final java.lang.Class<?> dmoClass
private static final java.util.Map<java.lang.reflect.Method,java.lang.reflect.Method> methodMap
MinimalTrans
methods to MetaTransImpl
methodsprivate static int nextTransNum
private final Persistence persistence
private final SecurityManager securityManager
private final TransactionTableUpdater.MinimalTrans proxy
private final TransactionTableUpdater.Handler handler
private final java.lang.Object lock
public TransactionTableUpdater(Database metaDB)
metaDB
- Metadata database helper object.public void transactionStarted(int64 transID)
transactionStarted
in interface TransactionListener
transID
- Unique identifier for the transaction.public void transactionEnded(int64 transID)
transactionEnded
in interface TransactionListener
transID
- Unique identifier for the transaction.