org.apache.tapestry5.ioc
Interface ServiceBindingOptions

All Known Implementing Classes:
ServiceBinderImpl

public interface ServiceBindingOptions

Allows additional options for a service to be specified, overriding hard coded defaults or defaults from annotations on the service.

See Also:
ServiceDef2

Method Summary
 ServiceBindingOptions eagerLoad()
          Turns eager loading on for this service.
 ServiceBindingOptions preventDecoration()
          Disallows service decoration for this service.
 ServiceBindingOptions preventReloading()
          Identifies a service for which live class reloading is not desired.
 ServiceBindingOptions scope(String scope)
          Sets the scope of the service, overriding the Scope annotation on the service implementation class.
 ServiceBindingOptions withId(String id)
          Allows a specific service id for the service to be provided, rather than the default (from the service interface).
<T extends Annotation>
ServiceBindingOptions
withMarker(Class<T>... marker)
          Defines the marker interface(s) for the service, used to connect injections by type at the point of injection with a particular service implementation, based on the intersection of type and marker interface.
 ServiceBindingOptions withSimpleId()
          Uses the the simple (unqualified) class name of the implementation class as the id of the service.
 

Method Detail

withId

ServiceBindingOptions withId(String id)
Allows a specific service id for the service to be provided, rather than the default (from the service interface). This is useful when multiple services implement the same interface, since service ids must be unique.

Parameters:
id -
Returns:
this binding options, for further configuration

withSimpleId

ServiceBindingOptions withSimpleId()
Uses the the simple (unqualified) class name of the implementation class as the id of the service.

Returns:
this binding options, for further configuration
Throws:
IllegalStateException - if the class name was not defined (via ServiceBinder.bind(Class, Class) or ServiceBinder.bind(Class)).
Since:
5.3

scope

ServiceBindingOptions scope(String scope)
Sets the scope of the service, overriding the Scope annotation on the service implementation class.

Parameters:
scope -
Returns:
this binding options, for further configuration
See Also:
ScopeConstants

eagerLoad

ServiceBindingOptions eagerLoad()
Turns eager loading on for this service. This may also be accomplished using the EagerLoad annotation on the service implementation class.

Returns:
this binding options, for further configuration

preventDecoration

ServiceBindingOptions preventDecoration()
Disallows service decoration for this service.

Returns:
this binding options, for further configuration

preventReloading

ServiceBindingOptions preventReloading()
Identifies a service for which live class reloading is not desired. This primarily applies to certain internal Tapestry services, and is necessary during the development of Tapestry itself. In user applications, services defined in library modules are not subject to reloading because the class files are stored in JARs, not as local file system files.

Since:
5.2.0

withMarker

<T extends Annotation> ServiceBindingOptions withMarker(Class<T>... marker)
Defines the marker interface(s) for the service, used to connect injections by type at the point of injection with a particular service implementation, based on the intersection of type and marker interface. The containing module will sometimes provide a set of default marker annotations for all services within the module, this method allows that default to be extended.

Type Parameters:
T -
Parameters:
marker - one or more markers to add
Returns:
this binding options, for further configuration


Copyright © 2003-2012 The Apache Software Foundation.