Reputation: 898
How do you specify the name of the function/method when calling a class using the Java component in Mule Anypoint-studio?
Upvotes: 1
Views: 1861
Reputation: 1277
If you are using Java Component, then you can try this directly into Configuration XML:
<component class="com.mulesoft.training.JavaWithMultipleMethods" doc:name="Java">
<method-entry-point-resolver>
<include-entry-point method="getMethod"/>
</method-entry-point-resolver>
</component>
Upvotes: 1
Reputation: 898
I found out you have to setup a bean by adding the following to your mule configuration xml file.
<spring:beans>
<spring:bean name="myBean" class="MyClass"/>
</spring:beans>
then use the Invoke component where you can specify the bean and the function/method you wish to call
<invoke name="aName" object-ref="myBean" method="raiseException" doc:name="Invoke"/>
Upvotes: 6