骡子ESB标注不工作 [英] Mule ESB annotation doesn't work

查看:163
本文介绍了骡子ESB标注不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用@Schedule诠释骡子ESB,但它不工作。我不知道什么是错。我的Java code:

 公共类MyCache {    @Schedule(间隔= 1000)
    公共无效writeStr(){        Log.debug(111112222222223333333334444444444);
        的System.out.println(111112222222223333333334444444444);
    }}


解决方案

有关超越想象,你在废弃使用 @Schedule 注释的Java组件的理由型号/服务容器为它工作。

您上面的类(即我放在 com.acme 包)的作品与骡子3.4.0以下内容:

 <模型>
    <服务名称=myCacheScheduler>
        &所述;成分>
            <单对象类=com.acme.MyCache/>
        < /成分>
    < /服务>
< /型号:GT;

I try to use @Schedule Annotation in mule esb, but it does not work. I don't know what's wrong with it. My java code :

public class MyCache {

    @Schedule(interval=1000)
    public void writeStr(){

        Log.debug("111112222222223333333334444444444");
        System.out.println("111112222222223333333334444444444");
    }

}

解决方案

For a reason that goes beyond imagination, you have to use @Schedule annotated Java components in the obsolete model/service container for it to work.

Your above class (that I put in the com.acme package) works with the following on Mule 3.4.0:

<model>
    <service name="myCacheScheduler">
        <component>
            <singleton-object class="com.acme.MyCache" />
        </component>
    </service>
</model>

这篇关于骡子ESB标注不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆