public class JNDIUtil extends Object
| Constructor and Description |
|---|
JNDIUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
bindUserTransaction(Configuration configuration,
Context context,
UserTransaction transaction)
Binds the specified
UserTransaction to the specified
JNDI context. |
static Context |
getContext(Configuration configuration)
Tries to get the JNDI context from the specified configuration.
|
static void |
initMockContextFactory()
Calls
MockContextFactory.setAsInitial(), if the
MockContextFactory is not already the current
context factory. |
static void |
resetMockContextFactory()
Calls
MockContextFactory.revertSetAsInitial(), if the
MockContextFactory is the current context factory. |
public static void initMockContextFactory()
throws NamingException
MockContextFactory.setAsInitial(), if the
MockContextFactory is not already the current
context factory.NamingExceptionpublic static void resetMockContextFactory()
MockContextFactory.revertSetAsInitial(), if the
MockContextFactory is the current context factory.public static Context getContext(Configuration configuration)
null for the context,
this method initializes the MockEJB JNDI implementation.configuration - the configurationpublic static void bindUserTransaction(Configuration configuration, Context context, UserTransaction transaction) throws NamingException
UserTransaction to the specified
JNDI context.configuration - the configurationcontext - the JNDI contexttransaction - the UserTransactionNamingExceptionCopyright © 2003–2018. All rights reserved.