org.apache.camel.util.jndi
Class CamelSingletonInitialContextFactory
java.lang.Object
org.apache.camel.util.jndi.CamelInitialContextFactory
org.apache.camel.util.jndi.CamelSingletonInitialContextFactory
- All Implemented Interfaces:
- InitialContextFactory
public class CamelSingletonInitialContextFactory
- extends CamelInitialContextFactory
A factory of the Camel InitialContext
which allows a Map
to be used to create a
JNDI context.
This implementation is singleton based, by creating a new context once, and reusing it on each call to
getInitialContext(java.util.Hashtable)
.
- Version:
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CamelSingletonInitialContextFactory
public CamelSingletonInitialContextFactory()
getInitialContext
public Context getInitialContext(Hashtable<?,?> environment)
throws NamingException
- Gets or creates the context with the given environment.
This implementation will create the context once, and then return the same instance
on multiple calls.
- Specified by:
getInitialContext
in interface InitialContextFactory
- Overrides:
getInitialContext
in class CamelInitialContextFactory
- Parameters:
environment
- the environment, must not be null
- Returns:
- the created context.
- Throws:
NamingException
- is thrown if creation failed.
Apache Camel