public class InvokerMessageProcessor extends AbstractAnnotatedObject 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.| Modifier and Type | Field and Description |
|---|---|
protected List<?> |
arguments |
protected Class<?>[] |
argumentTypes |
protected ExpressionManager |
expressionManager |
protected org.apache.commons.logging.Log |
logger |
protected Method |
method |
protected String |
methodName |
protected MuleContext |
muleContext |
protected String |
name |
protected Object |
object |
protected Class<?> |
objectType |
protected TemplateParser.PatternInfo |
patternInfo |
PHASE_NAMEPROPERTY_NAME| Constructor and Description |
|---|
InvokerMessageProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected MuleEvent |
createResultEvent(MuleEvent event,
Object result) |
protected Object[] |
evaluateArguments(MuleEvent event,
List<?> argumentTemplates) |
protected Object |
evaluateExpressionCandidate(Object expressionCandidate,
MuleMessage message) |
String |
getName() |
void |
initialise()
Method used to perform any initialisation work.
|
protected void |
lookupObjectInstance() |
MuleEvent |
process(MuleEvent event)
Invokes the MessageProcessor.
|
protected void |
resolveMethodToInvoke() |
void |
setArgumentExpressionsString(String arguments) |
void |
setArguments(List<?> arguments) |
void |
setArgumentTypes(Class<?>[] argumentTypes) |
void |
setMethodName(String methodName) |
void |
setMuleContext(MuleContext context) |
void |
setName(String name) |
void |
setObject(Object object) |
void |
setObjectType(Class<?> objectType) |
String |
toString() |
getAnnotation, getAnnotations, setAnnotationsprotected final transient org.apache.commons.logging.Log logger
protected Object object
protected Class<?> objectType
protected String methodName
protected List<?> arguments
protected Class<?>[] argumentTypes
protected String name
protected TemplateParser.PatternInfo patternInfo
protected Method method
protected ExpressionManager expressionManager
protected MuleContext muleContext
public void initialise()
throws InitialisationException
InitialisableInitialisationException 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 InitialisableInitialisationException - if a fatal error occurs causing the Mule instance to shutdownRecoverableException - if an error occurs that can be recovered fromprotected void resolveMethodToInvoke()
throws InitialisationException
InitialisationExceptionprotected void lookupObjectInstance()
throws InitialisationException
InitialisationExceptionpublic MuleEvent process(MuleEvent event) throws MuleException
MessageProcessorprocess in interface MessageProcessorevent - MuleEvent to be processedMuleExceptionprotected Object[] evaluateArguments(MuleEvent event, List<?> argumentTemplates) throws MessagingException
MessagingExceptionprotected Object evaluateExpressionCandidate(Object expressionCandidate, MuleMessage message) throws TransformerException
TransformerExceptionpublic void setObject(Object object)
public void setMethodName(String methodName)
public void setArgumentExpressionsString(String arguments)
public void setArguments(List<?> arguments)
protected MuleEvent createResultEvent(MuleEvent event, Object result) throws MuleException
MuleExceptionpublic String getName()
public void setName(String name)
public void setArgumentTypes(Class<?>[] argumentTypes)
public void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwarepublic void setObjectType(Class<?> objectType)
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.