[英]Calling Java method via a Mule Java component
在Mule Anypoint-studio中使用Java组件调用类时,如何指定函数/方法的名称?
I found out you have to setup a bean by adding the following to your mule configuration xml file. 我发现您必须通过将以下内容添加到m子配置xml文件中来设置bean。
<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组件,您可以在其中指定Bean和要调用的函数/方法
<invoke name="aName" object-ref="myBean" method="raiseException" doc:name="Invoke"/>
If you are using Java Component, then you can try this directly into Configuration XML: 如果您使用的是Java组件,则可以直接在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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.