Package org.apache.camel.support.jndi
Class CamelSingletonInitialContextFactory
- java.lang.Object
-
- org.apache.camel.support.jndi.CamelInitialContextFactory
-
- org.apache.camel.support.jndi.CamelSingletonInitialContextFactory
-
- All Implemented Interfaces:
InitialContextFactory
public class CamelSingletonInitialContextFactory extends CamelInitialContextFactory
A factory of the CamelInitialContext
which allows aMap
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 togetInitialContext(java.util.Hashtable)
.
-
-
Constructor Summary
Constructors Constructor Description CamelSingletonInitialContextFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Context
getInitialContext(Hashtable<?,?> environment)
Gets or creates the context with the given environment.
-
-
-
Method Detail
-
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 interfaceInitialContextFactory
- Overrides:
getInitialContext
in classCamelInitialContextFactory
- Parameters:
environment
- the environment, must not be null- Returns:
- the created context.
- Throws:
NamingException
- is thrown if creation failed.
-
-