org.apache.tapestry5.ioc.annotations
Annotation Type Scope
@Target(value={TYPE,METHOD})
@Retention(value=RUNTIME)
@Documented
@UseWith(value={SERVICE,MODULE})
public @interface Scope
An optional annotation that may be placed on a service building method of a module, or on the implementation class
(when using service binding). The annotation overrides the default scope for services (the default being a global
singleton that is instantiated on demand) for an alternate lifecycle. Alternate lifecycles are typically used to bind
a service implementation to a single thread or request. Modules may define new scopes. Each scope should have a
corresponding ServiceLifecycle
implementation. The linkage from scope name to service lifecycle occurs via a
contribution to the ServiceLifecycleSource
service configuration.
The annotation may also be placed directly on a service implementation class, when using service binding (via
the ServiceBinder
).
- See Also:
ScopeConstants
value
public abstract String value
- An identifier used to look up a non-default
ServiceLifecycle
.
Copyright © 2003-2012 The Apache Software Foundation.