org.mule.processor
Class InvokerMessageProcessor
java.lang.Object
org.mule.processor.InvokerMessageProcessor
- All Implemented Interfaces:
- MuleContextAware, Initialisable, MessageProcessor
public class InvokerMessageProcessor
- extends Object
- implements MessageProcessor, Initialisable, MuleContextAware
InvokerMessageProcessor
invokes a specified method of an object. An
array of argument expressions can be provided to map the message to the method
arguments. The method used is determined by the method name along with the number
of argument expressions provided. The results of the expression evaluations will
automatically be transformed where possible to the method argument type. Multiple
methods with the same name and same number of arguments are not supported
currently.
logger
protected final transient Log logger
object
protected Object object
objectType
protected Class<?> objectType
methodName
protected String methodName
arguments
protected List<?> arguments
argumentTypes
protected Class<?>[] argumentTypes
name
protected String name
patternInfo
protected TemplateParser.PatternInfo patternInfo
method
protected Method method
expressionManager
protected ExpressionManager expressionManager
muleContext
protected MuleContext muleContext
InvokerMessageProcessor
public InvokerMessageProcessor()
initialise
public void initialise()
throws InitialisationException
- Description copied from interface:
Initialisable
- Method used to perform any initialisation work. If a fatal error occurs during
initialisation an
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.
- Specified by:
initialise
in interface Initialisable
- Throws:
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdown
RecoverableException
- if an error occurs that can be recovered from
resolveMethodToInvoke
protected void resolveMethodToInvoke()
throws InitialisationException
- Throws:
InitialisationException
lookupObjectInstance
protected void lookupObjectInstance()
throws InitialisationException
- Throws:
InitialisationException
process
public MuleEvent process(MuleEvent event)
throws MuleException
- Description copied from interface:
MessageProcessor
- Invokes the MessageProcessor.
- Specified by:
process
in interface MessageProcessor
- Parameters:
event
- MuleEvent to be processed
- Returns:
- optional response MuleEvent
- Throws:
MuleException
evaluateArguments
protected Object[] evaluateArguments(MuleEvent event,
List<?> argumentTemplates)
throws MessagingException
- Throws:
MessagingException
evaluateExpressionCandidate
protected Object evaluateExpressionCandidate(Object expressionCandidate,
MuleMessage message)
throws TransformerException
- Throws:
TransformerException
setObject
public void setObject(Object object)
setMethodName
public void setMethodName(String methodName)
setArgumentExpressionsString
public void setArgumentExpressionsString(String arguments)
setArguments
public void setArguments(List<?> arguments)
createResultEvent
protected MuleEvent createResultEvent(MuleEvent event,
Object result)
throws MuleException
- Throws:
MuleException
getName
public String getName()
setName
public void setName(String name)
setArgumentTypes
public void setArgumentTypes(Class<?>[] argumentTypes)
toString
public String toString()
- Overrides:
toString
in class Object
setMuleContext
public void setMuleContext(MuleContext context)
- Specified by:
setMuleContext
in interface MuleContextAware
setObjectType
public void setObjectType(Class<?> objectType)
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.