|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.server.internal.JerseyResourceContext
public class JerseyResourceContext
Jersey implementation of JAX-RS resource context.
| Nested Class Summary | |
|---|---|
static class |
JerseyResourceContext.Binder
Injection binder for JerseyResourceContext. |
| Method Summary | ||
|---|---|---|
|
bindResource(Class<T> resourceClass)
Binds resourceClass into HK2 context as singleton. |
|
void |
bindResourceIfSingleton(Object resource)
Binds resourceClass into HK2 context as singleton. |
|
|
getResource(Class<T> resourceClass)
|
|
|
initResource(T resource)
|
|
|
unsafeBindResource(Class<T> resourceClass,
ContractProvider providerModel,
DynamicConfiguration dc)
Bind a resource class in a HK2 context. |
|
void |
unsafeBindResource(Object resource,
ContractProvider providerModel,
DynamicConfiguration dc)
Bind a resource instance in a HK2 context. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public <T> T getResource(Class<T> resourceClass)
getResource in interface ResourceContextpublic <T> T initResource(T resource)
initResource in interface ResourceContextpublic <T> void bindResource(Class<T> resourceClass)
resourceClass into HK2 context as singleton.
The bound class is then cached internally so that any sub-sequent attempt to bind that class
as a singleton is silently ignored.
T - type of the resource class.resourceClass - resource class that should be bound. If the class is not
annotated with Singleton annotation it
will be ignored by this method.public void bindResourceIfSingleton(Object resource)
resourceClass into HK2 context as singleton.
The bound class is then cached internally so that any sub-sequent attempt to bind that class
as a singleton is silently ignored.
resource - singleton resource instance that should be bound as singleton. If the class is not
annotated with Singleton annotation it
will be ignored by this method.
public void unsafeBindResource(Object resource,
ContractProvider providerModel,
DynamicConfiguration dc)
WARNING: This version of method is not synchronized as well as the cache is not checked for existing bindings before the resource is bound and cached.
resource - resource instance to be bound.providerModel - provider model for the resource class. If not null, the class
wil be bound as a contract provider too.dc - dynamic HK2 service locator configuration.
public <T> void unsafeBindResource(Class<T> resourceClass,
ContractProvider providerModel,
DynamicConfiguration dc)
WARNING: This version of method is not synchronized as well as the cache is not checked for existing bindings before the resource is bound and cached.
T - resource class type.resourceClass - resource class to be bound.providerModel - provider model for the class. If not null, the class
wil be bound as a contract provider too.dc - dynamic HK2 service locator configuration.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||