public class DefaultTransactionManagerLookup extends java.lang.Object implements TransactionManagerLookup
TransactionManagerLookup
implementation, that will be used by an initializing
Cache should the user have not specified otherwise.
This implementation will:
setProperties(java.util.Properties)
. That can be set in the CacheManager's configuration file.
The first TransactionManager instance is then kept and returned on each getTransactionManager()
callModifier and Type | Field and Description |
---|---|
private JndiSelector |
defaultJndiSelector |
private boolean |
initialized |
private java.util.concurrent.locks.Lock |
lock |
private static org.slf4j.Logger |
LOG |
private Selector |
selector |
private Selector[] |
transactionManagerSelectors |
private java.util.List<EhcacheXAResource> |
uninitializedEhcacheXAResources |
Constructor and Description |
---|
DefaultTransactionManagerLookup() |
Modifier and Type | Method and Description |
---|---|
javax.transaction.TransactionManager |
getTransactionManager()
Lookup available txnManagers
|
private java.util.Set<java.lang.String> |
getUninitializedXAResourceCacheNames() |
void |
init()
Switch the TransactionManagerLookup implementation to its initialized state.
|
private void |
lookupTransactionManager() |
void |
register(EhcacheXAResource resource,
boolean forRecovery)
execute txnManager specific code to register the XAResource for recovery.
|
void |
setProperties(java.util.Properties properties)
Setter to the properties properties.
|
void |
unregister(EhcacheXAResource resource,
boolean forRecovery)
execute txnManager specific code to unregister the XAResource for recovery.
|
private static final org.slf4j.Logger LOG
private final java.util.concurrent.locks.Lock lock
private final java.util.List<EhcacheXAResource> uninitializedEhcacheXAResources
private volatile boolean initialized
private volatile Selector selector
private final JndiSelector defaultJndiSelector
private final Selector[] transactionManagerSelectors
public void init()
init
in interface TransactionManagerLookup
private java.util.Set<java.lang.String> getUninitializedXAResourceCacheNames()
public javax.transaction.TransactionManager getTransactionManager()
getTransactionManager
in interface TransactionManagerLookup
private void lookupTransactionManager()
public void register(EhcacheXAResource resource, boolean forRecovery)
register
in interface TransactionManagerLookup
resource
- the XAResource to register for recovery in the choosen TM.forRecovery
- true if the XAResource is meant to be registered for recovery purpose only.public void unregister(EhcacheXAResource resource, boolean forRecovery)
unregister
in interface TransactionManagerLookup
resource
- the XAResource to register for recovery in the choosen TM.forRecovery
- true if the XAResource is meant to be registered for recovery purpose only.public void setProperties(java.util.Properties properties)
setProperties
in interface TransactionManagerLookup
properties
- the properties parsed from the config file's
transactionManagerLookup tag's properties attribute