public class AnnotatedEntryPointResolver extends AbstractEntryPointResolver
EntryPointResolver
implementation that will resolve methods on a service class
that have Mule expression annotations such as Payload
, InboundHeaders
It will transform the received message to match the annotated method arguments. For example -
public Object doSomething(
@XPath ("/foo/bar") String bar,
@Payload Document doc,
@InboundHeaders("name") String name)
{
//do stuff
}
The component method above will be invoked by running the XPath expression on the payload, adding a second parameter as
the payload itself and passing in the header 'name' as the third parameter.
There are some rules for how components with annotations will be processed -
MuleProperties.MULE_METHOD_PROPERTY
key.Payload
,
InboundHeaders
,
InboundAttachments
,
OutboundHeaders
,
OutboundAttachments
,
Mule
Constructor and Description |
---|
AnnotatedEntryPointResolver() |
Modifier and Type | Method and Description |
---|---|
protected Object[] |
getPayloadForMethod(Method method,
Object component,
MuleEventContext context) |
protected Object[] |
getPayloadFromMessageWithAnnotations(Method method,
MuleEventContext context) |
protected void |
initCache(Object component,
MuleEventContext context) |
InvocationResult |
invoke(Object component,
MuleEventContext context) |
String |
toString() |
addMethodByArguments, addMethodByName, getCacheKeyForPayload, getMethodByArguments, getMethodByName, getMethodCache, getPayloadFromMessage, invokeMethod, isAcceptVoidMethods, isSynchronizeCall, setAcceptVoidMethods, setSynchronizeCall
public InvocationResult invoke(Object component, MuleEventContext context) throws Exception
Exception
protected Object[] getPayloadForMethod(Method method, Object component, MuleEventContext context) throws TransformerException, InitialisationException
protected Object[] getPayloadFromMessageWithAnnotations(Method method, MuleEventContext context) throws TransformerException, InitialisationException
public String toString()
toString
in class AbstractEntryPointResolver
protected void initCache(Object component, MuleEventContext context)
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.