Package org.nuxeo.runtime.jtajca
Class NuxeoContainer
- java.lang.Object
-
- org.nuxeo.runtime.jtajca.NuxeoContainer
-
public class NuxeoContainer extends Object
Internal helper for the Nuxeo-defined transaction manager and connection manager.This code is called by the factories registered through JNDI, or by unit tests mimicking JNDI bindings.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NuxeoContainer.InstallContext
static class
NuxeoContainer.TransactionManagerConfiguration
static class
NuxeoContainer.TransactionManagerWrapper
Wraps a transaction manager for providing a dummy recoverable interface.static class
NuxeoContainer.UserTransactionImpl
User transaction that uses this container's transaction manager.
-
Field Summary
Fields Modifier and Type Field Description protected static io.dropwizard.metrics5.Counter
concurrentCount
protected static io.dropwizard.metrics5.Counter
concurrentMaxCount
protected static String
jndiPrefix
protected static Log
log
protected static Context
parentContext
protected static io.dropwizard.metrics5.MetricRegistry
registry
protected static io.dropwizard.metrics5.Counter
rollbackCount
protected static Context
rootContext
protected static ConcurrentHashMap<javax.transaction.Transaction,io.dropwizard.metrics5.Timer.Context>
timers
protected static javax.transaction.TransactionManager
tm
protected static org.apache.geronimo.transaction.manager.RecoverableTransactionManager
tmRecoverable
protected static javax.transaction.TransactionSynchronizationRegistry
tmSynchRegistry
protected static io.dropwizard.metrics5.Timer
transactionTimer
protected static javax.transaction.UserTransaction
ut
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static void
addBinding(Context dir, Name name, Object obj)
static void
addDeepBinding(String name, Object obj)
Bind object in root context.protected static void
addDeepBinding(Context dir, CompositeName comp, Object obj)
protected static org.apache.geronimo.transaction.manager.TransactionManagerImpl
createTransactionManager(NuxeoContainer.TransactionManagerConfiguration config)
protected static String
detectJNDIPrefix(Context context)
static Context
getRootContext()
Exposes therootContext
.static javax.transaction.TransactionManager
getTransactionManager()
Gets the transaction manager used by the container.protected static Reference
getTransactionManagerReference()
static javax.transaction.TransactionSynchronizationRegistry
getTransactionSynchronizationRegistry()
static javax.transaction.UserTransaction
getUserTransaction()
Gets the user transaction used by the container.protected static Reference
getUserTransactionReference()
protected static javax.transaction.TransactionManager
initTransactionManager(NuxeoContainer.TransactionManagerConfiguration config)
protected static void
install()
Install naming and bind transaction and connection management factories "by hand".protected static void
installTransactionManager(Context context)
protected static void
installTransactionManager(NuxeoContainer.TransactionManagerConfiguration config)
static boolean
isInstalled()
static <T> T
lookup(String name, Class<T> type)
static <T> T
lookup(Context context, String name, Class<T> type)
static String
nameOf(String name)
protected static void
removeBinding(String name)
protected static void
uninstall()
protected static NuxeoContainer.TransactionManagerWrapper
wrapTransactionManager(javax.transaction.TransactionManager tm)
-
-
-
Field Detail
-
log
protected static final Log log
-
tmRecoverable
protected static org.apache.geronimo.transaction.manager.RecoverableTransactionManager tmRecoverable
-
tm
protected static javax.transaction.TransactionManager tm
-
tmSynchRegistry
protected static javax.transaction.TransactionSynchronizationRegistry tmSynchRegistry
-
ut
protected static javax.transaction.UserTransaction ut
-
rootContext
protected static Context rootContext
-
parentContext
protected static Context parentContext
-
jndiPrefix
protected static String jndiPrefix
-
registry
protected static final io.dropwizard.metrics5.MetricRegistry registry
-
rollbackCount
protected static final io.dropwizard.metrics5.Counter rollbackCount
-
concurrentCount
protected static final io.dropwizard.metrics5.Counter concurrentCount
-
concurrentMaxCount
protected static final io.dropwizard.metrics5.Counter concurrentMaxCount
-
transactionTimer
protected static final io.dropwizard.metrics5.Timer transactionTimer
-
timers
protected static final ConcurrentHashMap<javax.transaction.Transaction,io.dropwizard.metrics5.Timer.Context> timers
-
-
Method Detail
-
install
protected static void install() throws NamingException
Install naming and bind transaction and connection management factories "by hand".- Throws:
NamingException
-
installTransactionManager
protected static void installTransactionManager(NuxeoContainer.TransactionManagerConfiguration config) throws NamingException
- Throws:
NamingException
-
isInstalled
public static boolean isInstalled()
-
uninstall
protected static void uninstall() throws NamingException
- Throws:
NamingException
-
getRootContext
public static Context getRootContext()
Exposes therootContext
.- Since:
- 5.7
- See Also:
- NXP-10331
-
addDeepBinding
public static void addDeepBinding(String name, Object obj) throws NamingException
Bind object in root context. Create needed sub contexts. since 5.6- Throws:
NamingException
-
addDeepBinding
protected static void addDeepBinding(Context dir, CompositeName comp, Object obj) throws NamingException
- Throws:
NamingException
-
addBinding
protected static void addBinding(Context dir, Name name, Object obj) throws NamingException
- Throws:
NamingException
-
removeBinding
protected static void removeBinding(String name) throws NamingException
- Throws:
NamingException
-
getTransactionManager
public static javax.transaction.TransactionManager getTransactionManager()
Gets the transaction manager used by the container.- Returns:
- the transaction manager
-
getTransactionManagerReference
protected static Reference getTransactionManagerReference()
-
getUserTransaction
public static javax.transaction.UserTransaction getUserTransaction()
Gets the user transaction used by the container.- Returns:
- the user transaction
-
getUserTransactionReference
protected static Reference getUserTransactionReference()
-
initTransactionManager
protected static javax.transaction.TransactionManager initTransactionManager(NuxeoContainer.TransactionManagerConfiguration config)
-
wrapTransactionManager
protected static NuxeoContainer.TransactionManagerWrapper wrapTransactionManager(javax.transaction.TransactionManager tm)
-
lookup
public static <T> T lookup(String name, Class<T> type) throws NamingException
- Throws:
NamingException
-
lookup
public static <T> T lookup(Context context, String name, Class<T> type) throws NamingException
- Throws:
NamingException
-
installTransactionManager
protected static void installTransactionManager(Context context) throws NamingException
- Throws:
NamingException
-
createTransactionManager
protected static org.apache.geronimo.transaction.manager.TransactionManagerImpl createTransactionManager(NuxeoContainer.TransactionManagerConfiguration config)
-
getTransactionSynchronizationRegistry
public static javax.transaction.TransactionSynchronizationRegistry getTransactionSynchronizationRegistry()
-
-