Package org.glassfish.jersey.inject.hk2
Class RequestContext
- java.lang.Object
-
- org.glassfish.jersey.inject.hk2.RequestContext
-
- All Implemented Interfaces:
org.glassfish.hk2.api.Context<RequestScoped>
@Singleton public class RequestContext extends java.lang.Object implements org.glassfish.hk2.api.Context<RequestScoped>
Class is able to communicate withRequestScopeand provide request-scoped descriptors to HK2 DI provider to create or destroy instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRequestContext.BinderRequest scope injection binder.
-
Field Summary
Fields Modifier and Type Field Description private RequestScoperequestScope
-
Constructor Summary
Constructors Constructor Description RequestContext(RequestScope requestScope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)voiddestroyOne(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)<U> UfindOrCreate(org.glassfish.hk2.api.ActiveDescriptor<U> activeDescriptor, org.glassfish.hk2.api.ServiceHandle<?> root)java.lang.Class<? extends java.lang.annotation.Annotation>getScope()booleanisActive()voidshutdown()booleansupportsNullCreation()
-
-
-
Field Detail
-
requestScope
private final RequestScope requestScope
-
-
Constructor Detail
-
RequestContext
@Inject public RequestContext(RequestScope requestScope)
-
-
Method Detail
-
getScope
public java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
- Specified by:
getScopein interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
findOrCreate
public <U> U findOrCreate(org.glassfish.hk2.api.ActiveDescriptor<U> activeDescriptor, org.glassfish.hk2.api.ServiceHandle<?> root)- Specified by:
findOrCreatein interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
containsKey
public boolean containsKey(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)
- Specified by:
containsKeyin interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
supportsNullCreation
public boolean supportsNullCreation()
- Specified by:
supportsNullCreationin interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
destroyOne
public void destroyOne(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)
- Specified by:
destroyOnein interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
-