public class TypeBasedTransformerResolver extends Object implements TransformerResolver, MuleContextAware, Disposable, Initialisable
TransformerResolver.RegistryAction
Modifier and Type | Field and Description |
---|---|
protected Map<String,Transformer> |
exactTransformerCache |
protected TransformerResolver |
graphTransformerResolver |
protected Log |
logger
logger used by this class
|
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
TypeBasedTransformerResolver() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
protected Transformer |
getNearestTransformerMatch(List<Transformer> trans,
Class input,
Class output) |
void |
initialise()
Method used to perform any initialisation work.
|
Transformer |
resolve(DataType source,
DataType result)
Responsible for finding a transformer with the given criteria.
|
void |
setMuleContext(MuleContext context) |
void |
transformerChange(Transformer transformer,
TransformerResolver.RegistryAction registryAction)
A callback that is called when a transformer is registered or unregistered
from the registry.
|
protected final transient Log logger
protected Map<String,Transformer> exactTransformerCache
protected TransformerResolver graphTransformerResolver
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
public void initialise() throws InitialisationException
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
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered frompublic Transformer resolve(DataType source, DataType result) throws ResolverException
TransformerResolver
resolve
in interface TransformerResolver
source
- information about the source object including the object iselfresult
- information about the result object to transform toResolverException
- Only thrown if an exception is thrown during the
search, this exception will just be a wrapperprotected Transformer getNearestTransformerMatch(List<Transformer> trans, Class input, Class output) throws ResolverException
ResolverException
public void dispose()
Disposable
dispose
in interface Disposable
public void transformerChange(Transformer transformer, TransformerResolver.RegistryAction registryAction)
TransformerResolver
transformerChange
in interface TransformerResolver
transformer
- the transformer that has changedregistryAction
- whether the transformer was added or removedCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.