Class SingletonServiceLifecycle
- java.lang.Object
- 
- org.apache.tapestry5.ioc.internal.SingletonServiceLifecycle
 
- 
- All Implemented Interfaces:
- ServiceLifecycle,- ServiceLifecycle2
 
 public class SingletonServiceLifecycle extends java.lang.Object implements ServiceLifecycle2 The basic implementation of a service lifecycle, which simply uses theObjectCreatorto create an instance of the service when asked.
- 
- 
Constructor SummaryConstructors Constructor Description SingletonServiceLifecycle()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectcreateService(ServiceResources resources, ObjectCreator creator)Returns the same creator, or a new one, that encapsulates the creation of the core service implementation.booleanisSingleton()Returns true if the lifecycle is a singleton (a service that will only be created once).booleanrequiresProxy()If true, then lifecycle requires a proxy, meaning it is only usable with services that properly define a service interface.
 
- 
- 
- 
Constructor Detail- 
SingletonServiceLifecyclepublic SingletonServiceLifecycle() 
 
- 
 - 
Method Detail- 
createServicepublic java.lang.Object createService(ServiceResources resources, ObjectCreator creator) Description copied from interface:ServiceLifecycleReturns the same creator, or a new one, that encapsulates the creation of the core service implementation.- Specified by:
- createServicein interface- ServiceLifecycle
- Parameters:
- 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 implementation
- creator- object capable of creating the service implementation on demand. This is a wrapper around the service's builder method.
- Returns:
- the service or equivalent service proxy
 
 - 
isSingletonpublic boolean isSingleton() Description copied from interface:ServiceLifecycleReturns true if the lifecycle is a singleton (a service that will only be created once). Return false if the underlying service instance may be created multiple times (for example, theScopeConstants.PERTHREADscope}. A future version of Tapestry IoC may optimize for the later case.- Specified by:
- isSingletonin interface- ServiceLifecycle
- Returns:
- true for singletons, false for services that can be repeatedly constructed
 
 - 
requiresProxypublic boolean requiresProxy() Description copied from interface:ServiceLifecycle2If true, then lifecycle requires a proxy, meaning it is only usable with services that properly define a service interface. The default (singleton) scope does not require a proxy, but most other service scopes do. The default (when wrapping aServiceLifecycleas aServiceLifecycle2is to return true.- Specified by:
- requiresProxyin interface- ServiceLifecycle2
- Returns:
- true if proxying is necessary, false otherwise
 
 
- 
 
-