MULE JAVA CUSTOM COMPONENT - 3
Ravinder
Reflection Entry Point Resolver:
 Reflection Entry Point Resolver is used to determine the entry
point of the component.
 Class method invocation happens based on the payload type as the
argument using reflection.
 For multiple parameters, the payload should be an Array of objects.
 If the payload is other than Array type then the respective method
which has same type of argument will be invoked.
 If the message payload is of type Null Payload the resolver will look
for a no-argument method.
 Below sub flow uses java components to implement Reflection Entry
Point Resolver
 Below java class "EntryPointResolver" has three methods with
different argument types.
 multipleArgumentsMethod
 singleArgumentMethod
 noArgumentsMethod(){
 Multiple Arguments method:
Drag an expression component and write code to create Array
(strArray) of two String objects. Store that Array object into payload.
 Drag a java component and refer to a class "EntryPointResolver".
 As the payload is Array of two objects after 'Expression'
component, "multipleArgumentsMethod(String name, String dept)"
method of "EntryPointResolver" Class gets invoked.
Single Argument method:
 Drag a 'Set Payload' component and set value a string value as
"RAM". Drag a java component and refer to a class
"EntryPointResolver" as shown earlier.
 As payload is String type after 'Set payload' component,
"singleArgumentMethod(String name)" method of
"EntryPointResolver" Class gets invoked.
Thank You All

Mule java part-3

  • 1.
    MULE JAVA CUSTOMCOMPONENT - 3 Ravinder
  • 2.
    Reflection Entry PointResolver:  Reflection Entry Point Resolver is used to determine the entry point of the component.  Class method invocation happens based on the payload type as the argument using reflection.  For multiple parameters, the payload should be an Array of objects.  If the payload is other than Array type then the respective method which has same type of argument will be invoked.  If the message payload is of type Null Payload the resolver will look for a no-argument method.
  • 3.
     Below subflow uses java components to implement Reflection Entry Point Resolver  Below java class "EntryPointResolver" has three methods with different argument types.  multipleArgumentsMethod  singleArgumentMethod  noArgumentsMethod(){
  • 5.
     Multiple Argumentsmethod: Drag an expression component and write code to create Array (strArray) of two String objects. Store that Array object into payload.
  • 6.
     Drag ajava component and refer to a class "EntryPointResolver".
  • 7.
     As thepayload is Array of two objects after 'Expression' component, "multipleArgumentsMethod(String name, String dept)" method of "EntryPointResolver" Class gets invoked. Single Argument method:  Drag a 'Set Payload' component and set value a string value as "RAM". Drag a java component and refer to a class "EntryPointResolver" as shown earlier.  As payload is String type after 'Set payload' component, "singleArgumentMethod(String name)" method of "EntryPointResolver" Class gets invoked.
  • 9.