Class BitronixInitialContextFactory

java.lang.Object
bitronix.tm.jndi.BitronixInitialContextFactory
All Implemented Interfaces:
InitialContextFactory

public class BitronixInitialContextFactory extends Object implements InitialContextFactory
Implementation of InitialContextFactory that allows lookup of transaction manager and registered resources.

The easiest way to use this provider is to create a jndi.properties file in your classpath with this content:

java.naming.factory.initial=bitronix.tm.jndi.BitronixInitialContextFactory
Alternatively, you can create a InitialContext object with an environment pointing to this class:
 Hashtable env = new Hashtable();
 env.put(Context.INITIAL_CONTEXT_FACTORY, "bitronix.tm.jndi.BitronixInitialContextFactory");
 Context ctx = new InitialContext(env);
 

The transaction manager can be looked up at the standard URL java:comp/UserTransaction while resources can be looked up using their unique name as set in ResourceBean.getUniqueName().

Author:
lorban
See Also: