public interface ServiceBinder
public static void bind(ServiceBinder binder). This is an adaptation of ideas from Guice.
|Modifier and Type||Method and Description|
Defines a service in terms of an implementation class, without a service interface.
Binds the service interface to a service implementation class.
Alternative implementation that supports a callback to build the service, rather than instantiating a particular class.
<T> ServiceBindingOptions bind(Class<T> implementationClass)
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.
implementationClass- class to instantiate as the service
<T> ServiceBindingOptions bind(Class<T> serviceInterface, ServiceBuilder<T> builder)
serviceInterface- interface implemented by the service
builder- constructs the core service implementation
<T> ServiceBindingOptions bind(Class<T> serviceInterface, Class<? extends T> serviceImplementation)
serviceInterface- service interface (used when locating services, and when building proxies)
serviceImplementation- implementation class that implements the service interface
5.6.1 - Copyright © 2003-2020 The Apache Software Foundation.