首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将流引用与java组件mule关联起来

将流引用与java组件mule关联起来
EN

Stack Overflow用户
提问于 2013-12-09 17:36:39
回答 1查看 346关注 0票数 0

我有一个主流,它从http端点开始,然后是实现该接口的soap组件,然后是实现该接口的java组件1。现在,我想添加一个flow ref,并在它后面添加一个实现相同接口的java组件2。我遇到了“找不到入口点”的问题,我现在正在学习本教程的blogs.mulesoft.org/mule-school-invoking-component-methods-using-entry-point-resolvers/

下面是我的流程。

代码语言:javascript
复制
<flow name="CreateAccountFlow1" doc:name="CreateAccountFlow1"> 
    <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" 
            doc:name="HTTP" path="bank"/> 
    <cxf:jaxws-service doc:name="SOAP" serviceClass="com.essai2.AccountService"/> 
    <component class="com.essai2.AccountRequest" doc:name="Java"/> 
    <logger level="INFO" doc:name="Logger"/> 
    <flow-ref name="Projet2Flow1" doc:name="Flow Reference"/> 
    <component class="com.essai2.AccountResponse" doc:name="Java"/> 
    <logger level="INFO" doc:name="Logger"/> 
</flow>

有谁可以帮我?

EN

回答 1

Stack Overflow用户

发布于 2016-05-20 11:32:30

代码语言:javascript
复制
In mule there are many ways to invoke a Java component.

1. Entry point resolver 
2. Implemnt mule Life Cycle API i.e callable
3. Invoke component.

when ever Mule finds Java component as message processors in a flow, tries to execute above three methods .

In the java component if you have created any methods with param same as mule message payload , Entry Point resolver is used.

eg :  class XYZ{
      method1(String s1){

      }
      method2(List<String> S2){
      }
}

If Mule Message Payload has type String then method1 is invoked, if message payload has List of String , method2 is invoked during run time.

2. If you can invoke the Java component in the flow irrespective of type of the payload, should implement Callable interface which overrides onCall() method.

for eg : class XYS implements Callable{
  @override 
  onCall(MuleEventConext muleEventConext){

} 

using MuleEvent Conext you can extract the payload and process it.

3. Using Invoke component, you can create the object of the Class and invoke explicitly the method with appropriate Parameters passed.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20467387

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档