|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.ioc.internal.ServiceBinderImpl
public class ServiceBinderImpl
Constructor Summary | |
---|---|
ServiceBinderImpl(ServiceDefAccumulator accumulator,
Method bindMethod,
PlasticProxyFactory proxyFactory,
Set<Class> defaultMarkers,
boolean moduleDefaultPreventDecoration)
|
Method Summary | ||
---|---|---|
|
bind(Class<T> serviceClass)
Defines a service in terms of an implementation class, without a service interface. |
|
|
bind(Class<T> serviceInterface,
Class<? extends T> serviceImplementation)
Binds the service interface to a service implementation class. |
|
|
bind(Class<T> serviceInterface,
ServiceBuilder<T> builder)
Alternative implementation that supports a callback to build the service, rather than instantiating a particular class. |
|
ServiceBindingOptions |
eagerLoad()
Turns eager loading on for this service. |
|
void |
finish()
|
|
protected void |
flush()
|
|
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). |
|
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceBinderImpl(ServiceDefAccumulator accumulator, Method bindMethod, PlasticProxyFactory proxyFactory, Set<Class> defaultMarkers, boolean moduleDefaultPreventDecoration)
Method Detail |
---|
public void finish()
protected void flush()
public <T> ServiceBindingOptions bind(Class<T> serviceClass)
ServiceBinder
ServiceDef.getServiceInterface()
will
return the implementation class. In this situation, the service will not be proxied; it will be instantiated
fully on first reference (ignoring its scope, if any) and will not be decorated.
bind
in interface ServiceBinder
serviceClass
- class to instantiate as the service
public <T> ServiceBindingOptions bind(Class<T> serviceInterface, ServiceBuilder<T> builder)
ServiceBinder
bind
in interface ServiceBinder
serviceInterface
- interface implemented by the servicebuilder
- constructs the core service implementation
public <T> ServiceBindingOptions bind(Class<T> serviceInterface, Class<? extends T> serviceImplementation)
ServiceBinder
Scope
annotation.
bind
in interface ServiceBinder
serviceInterface
- service interface (used when locating services, and when building proxies)serviceImplementation
- implementation class that implements the service interface
public ServiceBindingOptions eagerLoad()
ServiceBindingOptions
EagerLoad
annotation on
the service implementation class.
eagerLoad
in interface ServiceBindingOptions
public ServiceBindingOptions preventDecoration()
ServiceBindingOptions
preventDecoration
in interface ServiceBindingOptions
public ServiceBindingOptions preventReloading()
ServiceBindingOptions
preventReloading
in interface ServiceBindingOptions
public ServiceBindingOptions withId(String id)
ServiceBindingOptions
withId
in interface ServiceBindingOptions
public ServiceBindingOptions withSimpleId()
ServiceBindingOptions
withSimpleId
in interface ServiceBindingOptions
public ServiceBindingOptions scope(String scope)
ServiceBindingOptions
Scope
annotation on the service implementation class.
scope
in interface ServiceBindingOptions
ScopeConstants
public <T extends Annotation> ServiceBindingOptions withMarker(Class<T>... marker)
ServiceBindingOptions
withMarker
in interface ServiceBindingOptions
marker
- one or more markers to add
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |