285.5. 例
60 秒ごとにイベントを生成するルートを設定するには:
from("scheduler://foo?period=60s").to("bean:myBean?method=someMethodName");
from("scheduler://foo?period=60s").to("bean:myBean?method=someMethodName");
上記のルートはイベントを生成し、JNDI や Spring などのレジストリーで myBean
と呼ばれる Bean で someMethodName
メソッドを呼び出します。
そして、Spring DSL の経路:
<route> <from uri="scheduler://foo?period=60s"/> <to uri="bean:myBean?method=someMethodName"/> </route>
<route>
<from uri="scheduler://foo?period=60s"/>
<to uri="bean:myBean?method=someMethodName"/>
</route>