|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.internal.ProviderBinder
public class ProviderBinder
Class used for registration of the custom providers into HK2 services.
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 services
annotated by a @Custom qualifier annotation.
Use the @Custom qualifier annotation to retrieve these providers
from HK2 services. For example:
Collection<Provider<MessageBodyReader>> hk2Providers =
services.forContract(MessageBodyReader.class)
.annotatedWith(Custom.class)
.all();
You may also use a one of the provider accessor utility method defined in
Providers class.
| Nested Class Summary | |
|---|---|
static class |
ProviderBinder.ProviderBinderModule
Module which registers ProviderBinder into the the HK2 services. |
| Constructor Summary | |
|---|---|
ProviderBinder()
|
|
| Method Summary | ||
|---|---|---|
void |
bindClasses(java.lang.Class<?>... classes)
Register/bind custom provider classes. |
|
void |
bindClasses(java.lang.Iterable<java.lang.Class<?>> classes)
Register/bind custom provider classes. |
|
void |
bindClasses(java.lang.Iterable<java.lang.Class<?>> classes,
boolean bindResources)
Register/bind custom provider classes that may also be resources. |
|
void |
bindInstances(java.util.Set<java.lang.Object> instances)
Register/bind custom provider instances. |
|
|
bindInstances(T... instances)
Register/bind custom provider instances. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProviderBinder()
| Method Detail |
|---|
public <T> void bindInstances(T... instances)
instances - custom provider instances.public void bindInstances(java.util.Set<java.lang.Object> instances)
instances - custom provider instances.public void bindClasses(java.lang.Class<?>... classes)
PerLookup.
classes - custom provider classes.public void bindClasses(java.lang.Iterable<java.lang.Class<?>> classes)
PerLookup.
classes - custom provider classes.
public void bindClasses(java.lang.Iterable<java.lang.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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||