bitronix.tm.jndi
Class BitronixInitialContextFactory

java.lang.Object
  extended bybitronix.tm.jndi.BitronixInitialContextFactory
All Implemented Interfaces:
javax.naming.spi.InitialContextFactory

public class BitronixInitialContextFactory
extends java.lang.Object
implements javax.naming.spi.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().

© Bitronix Software

Author:
lorban
See Also:
BitronixContext

Constructor Summary
BitronixInitialContextFactory()
           
 
Method Summary
 javax.naming.Context getInitialContext(java.util.Hashtable hashtable)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitronixInitialContextFactory

public BitronixInitialContextFactory()
Method Detail

getInitialContext

public javax.naming.Context getInitialContext(java.util.Hashtable hashtable)
                                       throws javax.naming.NamingException
Specified by:
getInitialContext in interface javax.naming.spi.InitialContextFactory
Throws:
javax.naming.NamingException

toString

public java.lang.String toString()