public class JndiRegistry extends Object implements Registry
Registry implementation which looks up the objects in JNDI| Constructor and Description |
|---|
JndiRegistry() |
JndiRegistry(boolean standalone)
Whether to use standalone mode, where the JNDI initial context factory is using
CamelInitialContextFactory. |
JndiRegistry(Context context) |
JndiRegistry(Map environment) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(String name,
Object object) |
void |
close() |
protected Context |
createContext() |
<T> Set<T> |
findByType(Class<T> type)
Finds services in the registry by their type.
|
<T> Map<String,T> |
findByTypeWithName(Class<T> type)
Finds services in the registry by their type.
|
Context |
getContext() |
Object |
lookup(String name)
Looks up a service in the registry based purely on name,
returning the service or null if it could not be found.
|
<T> T |
lookup(String name,
Class<T> type)
Looks up a service in the registry, returning the service or null if it could not be found.
|
Object |
lookupByName(String name)
Looks up a service in the registry based purely on name,
returning the service or null if it could not be found.
|
<T> T |
lookupByNameAndType(String name,
Class<T> type)
Looks up a service in the registry, returning the service or null if it could not be found.
|
<T> Map<String,T> |
lookupByType(Class<T> type)
Looks up services in the registry by their type.
|
void |
setContext(Context context) |
public JndiRegistry()
public JndiRegistry(Map environment)
public JndiRegistry(Context context)
public JndiRegistry(boolean standalone)
CamelInitialContextFactory.public <T> T lookupByNameAndType(String name, Class<T> type)
RegistrylookupByNameAndType in interface Registryname - the name of the servicetype - the type of the required servicepublic Object lookupByName(String name)
RegistrylookupByName in interface Registryname - the name of the servicepublic <T> Map<String,T> findByTypeWithName(Class<T> type)
RegistryfindByTypeWithName in interface Registrytype - the type of the registered servicespublic <T> Set<T> findByType(Class<T> type)
RegistryfindByType in interface Registrytype - the type of the registered servicespublic Object lookup(String name)
Registrypublic <T> T lookup(String name, Class<T> type)
Registrypublic <T> Map<String,T> lookupByType(Class<T> type)
RegistryJndiRegistry.lookupByType in interface Registrytype - the type of the registered servicespublic void close() throws NamingException
NamingExceptionpublic Context getContext() throws NamingException
NamingExceptionpublic void setContext(Context context)
protected Context createContext() throws NamingException
NamingExceptionApache Camel