MULE JAVA CUSTOM COMPONENT - 4
Ravinder
No Arguments method:
 Drag a 'Set Payload' component and set value a string value as
"#[null]". So that payload becomes null. Drag a java component and
refer to a class "EntryPointResolver" as shown earlier.
 As payload is null after 'Set payload' component,
"noArgumentsMethod()" method of "EntryPointResolver" Class gets
invoked.
Annotated Entry Point Resolver:
 Annotated Entry Point Resolver is used to determine the entry
point of the component using annotations.
Example:
 In below flow 'Set Payload' component has been used to set a
String as "RAM" and 'Property' component has been to create
outbound property (dept = IT). A Java component is used to refer a
java class "AnnotatedEntryPointerResolver".
 Below java class has a method multipleArgumentsMethod(@Payload
String name, @OutboundHeaders Map<String, Object> dept) which
has two arguments referred by annotations. Based on the annotation
the respective value gets match to the argument.
 For example, payload value matches to the argument 'name'.
@Payload String name
 In the same way, all outbound properties match to the argument 'dept'
which is type java.util.Map.
@OutboundHeaders Map<String, Object> dept
Invoking a service using java component:
 In this example a java component is reffered to a class
"HTTPInvocation" which invokes another HTTP service and returns
the HTTP resoponse. Logger component is used to log the response.
Java Class:
Thank You All

Mule java part-4

  • 1.
    MULE JAVA CUSTOMCOMPONENT - 4 Ravinder
  • 2.
    No Arguments method: Drag a 'Set Payload' component and set value a string value as "#[null]". So that payload becomes null. Drag a java component and refer to a class "EntryPointResolver" as shown earlier.
  • 3.
     As payloadis null after 'Set payload' component, "noArgumentsMethod()" method of "EntryPointResolver" Class gets invoked. Annotated Entry Point Resolver:  Annotated Entry Point Resolver is used to determine the entry point of the component using annotations. Example:  In below flow 'Set Payload' component has been used to set a String as "RAM" and 'Property' component has been to create outbound property (dept = IT). A Java component is used to refer a java class "AnnotatedEntryPointerResolver".
  • 4.
     Below javaclass has a method multipleArgumentsMethod(@Payload String name, @OutboundHeaders Map<String, Object> dept) which has two arguments referred by annotations. Based on the annotation the respective value gets match to the argument.
  • 5.
     For example,payload value matches to the argument 'name'. @Payload String name  In the same way, all outbound properties match to the argument 'dept' which is type java.util.Map. @OutboundHeaders Map<String, Object> dept
  • 6.
    Invoking a serviceusing java component:  In this example a java component is reffered to a class "HTTPInvocation" which invokes another HTTP service and returns the HTTP resoponse. Logger component is used to log the response.
  • 7.
  • 9.