public class Configuration extends Object
| Constructor and Description |
|---|
Configuration() |
Configuration(String userTransactionJNDIName) |
Configuration(String userTransactionJNDIName,
boolean bindMockUserTransactionToJNDI) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBindMockUserTransactionToJNDI()
Get if the mock transaction should be bound to JNDI.
|
Context |
getContext()
Get the JNDI context.
|
String |
getUserTransactionJNDIName()
Get the JNDI name for the user transaction.
|
void |
setBindMockUserTransactionToJNDI(boolean bindMockUserTransactionToJNDI)
Set if the mock transaction should be bound to JNDI.
|
void |
setContext(Context context)
Set the JNDI context used by
EJBMockObjectFactory. |
void |
setUserTransactionJNDIName(String userTransactionJNDIName)
Set the JNDI name for the user transaction.
|
public Configuration()
public Configuration(String userTransactionJNDIName)
public Configuration(String userTransactionJNDIName, boolean bindMockUserTransactionToJNDI)
public Context getContext()
null if no context
is set. In this case the EJBMockObjectFactory
uses the MockEJB JNDI implementation.public void setContext(Context context)
EJBMockObjectFactory.context - the JNDI contextpublic boolean getBindMockUserTransactionToJNDI()
public void setBindMockUserTransactionToJNDI(boolean bindMockUserTransactionToJNDI)
EJBMockObjectFactory
creates a MockUserTransaction,
it tries to rebind the transaction to the JNDI tree with the
specified name setUserTransactionJNDIName(java.lang.String), the name
javax.transaction.UserTransaction (which is used
by MockEJB and Weblogic) and the name
java:comp/UserTransaction (which is the standard name),
if this option is true.
If this option is false, a mock transaction is created
but not bound to JNDI.
Default is true.bindMockUserTransactionToJNDI - should the mock transaction be bound to JNDIpublic String getUserTransactionJNDIName()
public void setUserTransactionJNDIName(String userTransactionJNDIName)
EJBMockObjectFactory tries to
obtain a UserTransaction from JNDI using this
name. If the lookup fails, a MockUserTransaction
is created and bound to JNDI, if setBindMockUserTransactionToJNDI(boolean) is
set to true.
Default is javax.transaction.UserTransaction.userTransactionJNDIName - the JNDI name for the user transactionCopyright © 2003–2018. All rights reserved.