|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.internal.inject.ProviderBinder
public class ProviderBinder
Class used for registration of the custom providers into HK2 service locator.
Custom providers are classes that implements specific JAX-RS or Jersey
SPI interfaces (e.g. MessageBodyReader) and are
supplied by the user. These providers will be bound into the HK2 service locator
annotated by a @Custom qualifier annotation.
Use the @Custom qualifier annotation to retrieve these providers
from HK2 service locator. You may also use a one of the provider accessor utility
method defined in Providers class.
| Constructor Summary | |
|---|---|
ProviderBinder(ServiceLocator locator)
Create new provider binder instance. |
|
| Method Summary | |
|---|---|
void |
bindClasses(Class<?>... classes)
Register/bind custom provider classes. |
void |
bindClasses(Iterable<Class<?>> classes)
Register/bind custom provider classes. |
void |
bindClasses(Iterable<Class<?>> classes,
boolean bindResources)
Register/bind custom provider classes that may also be resources. |
void |
bindInstances(Iterable<Object> instances)
Register/bind custom provider instances. |
static void |
bindProvider(Class<?> providerClass,
ContractProvider model,
DynamicConfiguration dc)
Bind contract provider model to a provider class using the supplied HK2 dynamic configuration. |
static void |
bindProvider(Object providerInstance,
ContractProvider model,
DynamicConfiguration dc)
Bind contract provider model to a provider instance using the supplied HK2 dynamic configuration. |
static void |
bindProviders(ComponentBag componentBag,
RuntimeType constrainedTo,
Set<Class<?>> registeredClasses,
DynamicConfiguration dynamicConfiguration)
Bind all providers contained in providerBag (classes and instances) using HK2 service locator. |
static void |
bindProviders(ComponentBag componentBag,
RuntimeType constrainedTo,
Set<Class<?>> registeredClasses,
ServiceLocator locator)
Bind all providers contained in providerBag (classes and instances) using HK2 service locator. |
static void |
bindProviders(ComponentBag componentBag,
ServiceLocator locator)
Bind all providers contained in providerBag (classes and instances) using HK2 service locator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProviderBinder(ServiceLocator locator)
locator - HK2 service locator the binder will use to bind the
providers into.| Method Detail |
|---|
public void bindInstances(Iterable<Object> instances)
instances - custom provider instances.public void bindClasses(Class<?>... classes)
PerLookup.
classes - custom provider classes.public void bindClasses(Iterable<Class<?>> classes)
PerLookup.
classes - custom provider classes.
public void bindClasses(Iterable<Class<?>> classes,
boolean bindResources)
PerLookup.
If bindAsResources is set to true, the providers will also be bound
as resources.
classes - custom provider classes.bindResources - if true, the provider classes will also be bound as
resources.
public static void bindProvider(Class<?> providerClass,
ContractProvider model,
DynamicConfiguration dc)
providerClass - provider class.model - contract provider model.dc - HK2 dynamic service locator configuration.
public static void bindProvider(Object providerInstance,
ContractProvider model,
DynamicConfiguration dc)
contract provider model
is ignored as instances can only be bound as "singletons".
providerInstance - provider instance.model - contract provider model.dc - HK2 dynamic service locator configuration.
public static void bindProviders(ComponentBag componentBag,
ServiceLocator locator)
providerBag (classes and instances) using HK2 service locator. Configuration is
also committed.
componentBag - bag of provider classes and instances.locator - HK2 service locator the binder will use to bind the providers into.
public static void bindProviders(ComponentBag componentBag,
RuntimeType constrainedTo,
Set<Class<?>> registeredClasses,
ServiceLocator locator)
providerBag (classes and instances) using HK2 service locator. Configuration is
also committed.
componentBag - bag of provider classes and instances.constrainedTo - current runtime (client or server).registeredClasses - classes which are manually registered by the user (not found by the classpath scanning).locator - HK2 service locator the binder will use to bind the providers into.
public static void bindProviders(ComponentBag componentBag,
RuntimeType constrainedTo,
Set<Class<?>> registeredClasses,
DynamicConfiguration dynamicConfiguration)
providerBag (classes and instances) using HK2 service locator. Configuration is
not committed.
componentBag - bag of provider classes and instances.constrainedTo - current runtime (client or server).registeredClasses - classes which are manually registered by the user (not found by the classpath scanning).dynamicConfiguration - HK2 dynamic service locator configuration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||