|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tapestry5.ioc.internal.services.PerThreadServiceLifecycle
public class PerThreadServiceLifecycle
Allows a service to exist "per thread" (in each thread). Creates a proxy that delegates to a per-thread instance.
This scheme ensures that, although the service builder method will be invoked many times over the life of the application, the service decoration process occurs only once. The final calling chain is: Service Proxy --> Interceptor(s) (from Decorators) --> Advise Proxy (from Advisiors) --> PerThread Proxy --> (per thread) instance.
Constructor Summary | |
---|---|
PerThreadServiceLifecycle(PerthreadManager perthreadManager,
PlasticProxyFactory proxyFactory)
|
Method Summary | |
---|---|
java.lang.Object |
createService(ServiceResources resources,
ObjectCreator creator)
Returns the same creator, or a new one, that encapsulates the creation of the core service implementation. |
boolean |
isSingleton()
Returns false; this lifecycle represents a service that will be created many times (by each thread). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PerThreadServiceLifecycle(@Builtin PerthreadManager perthreadManager, @Builtin PlasticProxyFactory proxyFactory)
Method Detail |
---|
public boolean isSingleton()
isSingleton
in interface ServiceLifecycle
public java.lang.Object createService(ServiceResources resources, ObjectCreator creator)
ServiceLifecycle
createService
in interface ServiceLifecycle
resources
- source of information about the service to be created, and source of additional services or
other resources that may be needed when constructing the core service implementationcreator
- object capable of creating the service implementation on demand. This is a wrapper around the
service's builder method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |