Thursday, July 31, 2008

Scope and Eager Loading of Tapestry5 Service

在T5中多数service的作用域为"singleton"的,当其interface被使用,则会为此service创建一个代理proxy,此时处于"virtual"阶段,当service中任一方法被调用,即进行"realization"阶段。
这种作用域的service需要注意线程安全,可能会多线程同时调用此service。相对应的还有种service作用域为"perthread"。

当service定义时用了@EagerLoad,Tapestry在Register被创建的时候就会实例化这些service。
Reference: http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html

No comments :