You let HiveMind inject stuff into your service that runs at startup:
HiveMind will "autowire" the MyService object into your MyStartupClass object (unless there is more than one service point within your HiveMind registry which implements the MyService interface). Then, declare your service point in the HiveMind module:
Then, register your service with the startup configuration point:
That's it! Your Runnable class will now run upon registry startup (creation), which happens in a Tapestry application when the application servlet starts up.
From James Carman(james@carmanconsulting.com)
public class MyStartupClass implements Runnable
{
private MyService myService;
public void setMyService( MyService myService )
{
this.myService = myService;
}
public void run()
{
myService.doSomethingThatMyServiceDoes();
}
}
HiveMind will "autowire" the MyService object into your MyStartupClass object (unless there is more than one service point within your HiveMind registry which implements the MyService interface). Then, declare your service point in the HiveMind module:
<service-point id="SomeIdYouChoose" interface="java.lang.Runnable"> <invoke-factory> <construct class="com.myco.somepackage.MyStartupClass" /> </invoke-factory> </service-point>
Then, register your service with the startup configuration point:
<contribution configuration-id="hivemind.Startup"> <startup object="service:SomeIdYouChoose" /> </contribution>
That's it! Your Runnable class will now run upon registry startup (creation), which happens in a Tapestry application when the application servlet starts up.
From James Carman(james@carmanconsulting.com)
- 14:49
- 浏览 (1160)
- 评论 (0)
- 分类: Tapestry4 FAQ
- 发布在 Tapestry 圈子
- 相关推荐
发表评论
- 浏览: 91615 次

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
Tapestry5-如何在根目录下 ...
o,是我看的不仔细。不过我都是放在class相对应的资源包中。
-- by KorbenZhang -
Tapestry5-如何在根目录下 ...
文章提到的是组件类的模板,页面类默认是在根目录的。
-- by tapestry -
Tapestry5-如何在根目录下 ...
过时了,T5已经把tml文件放在根目录了。
-- by KorbenZhang -
Tapestry5开发系列:如何 ...
我删掉了依赖,加了servlet还是不行,jetty就是不起来,说没找到logg ...
-- by leegorous -
Tapestry5每日播报(20080 ...
非常支持.
-- by biaoming






评论排行榜