Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.impl.model.resolvers
Class AnnotatedEntryPointResolver

    java.lang.Object
      org.mule.model.resolvers.AbstractEntryPointResolver
          org.mule.impl.model.resolvers.AnnotatedEntryPointResolver

All Implemented Interfaces:
  EntryPointResolver

    public class AnnotatedEntryPointResolver

extends AbstractEntryPointResolver

A Mule `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 -

- For components with more than one method annotated with Mule expression annotations the method name to call needs to be set on the incoming message or endpoint using the `MuleProperties.MULE_METHOD_PROPERTY` key.
- If the component has only one method annotated with Mule expression annotations there is no need to set the method name to invoke
- Every parameter on the method needs to be annotated

Since:
  3.0
See Also:
  `Payload`, `InboundHeaders`, `InboundAttachments`, `OutboundHeaders`, `OutboundAttachments`, `Mule`

Field Summary

Fields inherited from class org.mule.model.resolvers.AbstractEntryPointResolver
`logger, methodCache`

Constructor Summary
`AnnotatedEntryPointResolver()`

Method Summary
`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()`

Methods inherited from class org.mule.model.resolvers.AbstractEntryPointResolver
`addMethodByArguments, addMethodByName, getCacheKeyForPayload, getMethodByArguments, getMethodByName, getPayloadFromMessage, invokeMethod, isAcceptVoidMethods, isSynchronizeCall, setAcceptVoidMethods, setSynchronizeCall`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AnnotatedEntryPointResolver

    public AnnotatedEntryPointResolver()

Method Detail

### invoke

    public InvocationResult invoke(Object component,
                                   MuleEventContext context)
                            throws Exception

  Throws:
    `Exception`

### getPayloadForMethod

    protected Object[] getPayloadForMethod(Method method,
                                           Object component,
                                           MuleEventContext context)
                                    throws TransformerException,
                                           InitialisationException

  Throws:
    `TransformerException`
    `InitialisationException`

### getPayloadFromMessageWithAnnotations

    protected Object[] getPayloadFromMessageWithAnnotations(Method method,
                                                            MuleEventContext context)
                                                     throws TransformerException,
                                                            InitialisationException

  Throws:
    `TransformerException`
    `InitialisationException`

### toString

    public String toString()

  Overrides:
    `toString` in class `AbstractEntryPointResolver`

### initCache

    protected void initCache(Object component,
                             MuleEventContext context)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.