|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mockrunner.ejb.Configuration
public class Configuration
Global configuration options regarding EJB and JNDI. Usually you do not have to change these options.
Constructor Summary | |
---|---|
Configuration()
|
|
Configuration(java.lang.String userTransactionJNDIName)
|
|
Configuration(java.lang.String userTransactionJNDIName,
boolean bindMockUserTransactionToJNDI)
|
Method Summary | |
---|---|
boolean |
getBindMockUserTransactionToJNDI()
Get if the mock transaction should be bound to JNDI. |
javax.naming.Context |
getContext()
Get the JNDI context. |
java.lang.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(javax.naming.Context context)
Set the JNDI context used by EJBMockObjectFactory . |
void |
setUserTransactionJNDIName(java.lang.String userTransactionJNDIName)
Set the JNDI name for the user transaction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Configuration()
public Configuration(java.lang.String userTransactionJNDIName)
public Configuration(java.lang.String userTransactionJNDIName, boolean bindMockUserTransactionToJNDI)
Method Detail |
---|
public javax.naming.Context getContext()
null
if no context
is set. In this case the EJBMockObjectFactory
uses the MockEJB JNDI implementation.
public void setContext(javax.naming.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 java.lang.String getUserTransactionJNDIName()
public void setUserTransactionJNDIName(java.lang.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 transaction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |