public class CachedJndiNameResolver extends AbstractJndiNameResolver
JndiNameResolver
that uses a cache in order to store
the already resolved names.
The cache does not have an automated mechanism for cleaning up the data.
In case of getting corrupt data, a way to cleaning up the cache is to stop
and then restart the instance.Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
cache |
logger
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
CachedJndiNameResolver() |
Modifier and Type | Method and Description |
---|---|
void |
initialise()
Method used to perform any initialisation work.
|
Object |
lookup(String name)
Looks up an object by name.
|
void |
stop()
Cleans up the cache.
|
createInitialContext, dispose, getContextFactory, getContextProperties, getJndiInitialFactory, getJndiProviderProperties, getJndiProviderUrl, setContextFactory, setJndiInitialFactory, setJndiProviderProperties, setJndiProviderUrl, start
public Object lookup(String name) throws NamingException
JndiNameResolver
name
- the name of the object to search forNamingException
- is there is an error during the lookup.public void initialise()
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
initialise
in class AbstractJndiNameResolver
public void stop() throws MuleException
stop
in interface Stoppable
stop
in class AbstractJndiNameResolver
MuleException
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.