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 classNuxeoContainer.InstallContextstatic classNuxeoContainer.TransactionManagerConfigurationstatic classNuxeoContainer.TransactionManagerWrapperWraps a transaction manager for providing a dummy recoverable interface.static classNuxeoContainer.UserTransactionImplUser transaction that uses this container's transaction manager.
-
Field Summary
Fields Modifier and Type Field Description protected static io.dropwizard.metrics5.CounterconcurrentCountprotected static io.dropwizard.metrics5.CounterconcurrentMaxCountprotected static StringjndiPrefixprotected static Loglogprotected static ContextparentContextprotected static io.dropwizard.metrics5.MetricRegistryregistryprotected static io.dropwizard.metrics5.CounterrollbackCountprotected static ContextrootContextprotected static ConcurrentHashMap<javax.transaction.Transaction,io.dropwizard.metrics5.Timer.Context>timersprotected static javax.transaction.TransactionManagertmprotected static org.apache.geronimo.transaction.manager.RecoverableTransactionManagertmRecoverableprotected static javax.transaction.TransactionSynchronizationRegistrytmSynchRegistryprotected static io.dropwizard.metrics5.TimertransactionTimerprotected static javax.transaction.UserTransactionut
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static voidaddBinding(Context dir, Name name, Object obj)static voidaddDeepBinding(String name, Object obj)Bind object in root context.protected static voidaddDeepBinding(Context dir, CompositeName comp, Object obj)protected static org.apache.geronimo.transaction.manager.TransactionManagerImplcreateTransactionManager(NuxeoContainer.TransactionManagerConfiguration config)protected static StringdetectJNDIPrefix(Context context)static ContextgetRootContext()Exposes therootContext.static javax.transaction.TransactionManagergetTransactionManager()Gets the transaction manager used by the container.protected static ReferencegetTransactionManagerReference()static javax.transaction.TransactionSynchronizationRegistrygetTransactionSynchronizationRegistry()static javax.transaction.UserTransactiongetUserTransaction()Gets the user transaction used by the container.protected static ReferencegetUserTransactionReference()protected static javax.transaction.TransactionManagerinitTransactionManager(NuxeoContainer.TransactionManagerConfiguration config)protected static voidinstall()Install naming and bind transaction and connection management factories "by hand".protected static voidinstallTransactionManager(Context context)protected static voidinstallTransactionManager(NuxeoContainer.TransactionManagerConfiguration config)static booleanisInstalled()static <T> Tlookup(String name, Class<T> type)static <T> Tlookup(Context context, String name, Class<T> type)static StringnameOf(String name)protected static voidremoveBinding(String name)protected static voiduninstall()protected static NuxeoContainer.TransactionManagerWrapperwrapTransactionManager(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 NamingExceptionInstall 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()
-
-