public class ServiceBinderImpl extends Object implements ServiceBinder, ServiceBindingOptions
| Constructor and Description |
|---|
ServiceBinderImpl(ServiceDefAccumulator accumulator,
Method bindMethod,
PlasticProxyFactory proxyFactory,
Set<Class> defaultMarkers,
boolean moduleDefaultPreventDecoration) |
| Modifier and Type | Method and Description |
|---|---|
<T> ServiceBindingOptions |
bind(Class<T> serviceClass)
Defines a service in terms of an implementation class, without a service interface.
|
<T> ServiceBindingOptions |
bind(Class<T> serviceInterface,
Class<? extends T> serviceImplementation)
Binds the service interface to a service implementation class.
|
<T> ServiceBindingOptions |
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).
|
ServiceBindingOptions |
withMarker(Class<? extends Annotation>... 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.
|
public ServiceBinderImpl(ServiceDefAccumulator accumulator, Method bindMethod, PlasticProxyFactory proxyFactory, Set<Class> defaultMarkers, boolean moduleDefaultPreventDecoration)
public void finish()
protected void flush()
public <T> ServiceBindingOptions bind(Class<T> serviceClass)
ServiceBinderServiceDef.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 ServiceBinderserviceClass - class to instantiate as the servicepublic <T> ServiceBindingOptions bind(Class<T> serviceInterface, ServiceBuilder<T> builder)
ServiceBinderbind in interface ServiceBinderserviceInterface - interface implemented by the servicebuilder - constructs the core service implementationpublic <T> ServiceBindingOptions bind(Class<T> serviceInterface, Class<? extends T> serviceImplementation)
ServiceBinderScope annotation.bind in interface ServiceBinderserviceInterface - service interface (used when locating services, and when building proxies)serviceImplementation - implementation class that implements the service interfacepublic ServiceBindingOptions eagerLoad()
ServiceBindingOptionsEagerLoad annotation on
the service implementation class.eagerLoad in interface ServiceBindingOptionspublic ServiceBindingOptions preventDecoration()
ServiceBindingOptionspreventDecoration in interface ServiceBindingOptionspublic ServiceBindingOptions preventReloading()
ServiceBindingOptionspreventReloading in interface ServiceBindingOptionspublic ServiceBindingOptions withId(String id)
ServiceBindingOptionswithId in interface ServiceBindingOptionspublic ServiceBindingOptions withSimpleId()
ServiceBindingOptionswithSimpleId in interface ServiceBindingOptionspublic ServiceBindingOptions scope(String scope)
ServiceBindingOptionsScope annotation on the service implementation class.scope in interface ServiceBindingOptionsScopeConstantspublic ServiceBindingOptions withMarker(Class<? extends Annotation>... marker)
ServiceBindingOptionswithMarker in interface ServiceBindingOptionsmarker - one or more markers to add5.6.4 - Copyright © 2003-2021 The Apache Software Foundation.