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 withRequestScope
and provide request-scoped descriptors to HK2 DI provider to create or destroy instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RequestContext.Binder
Request scope injection binder.
-
Field Summary
Fields Modifier and Type Field Description private RequestScope
requestScope
-
Constructor Summary
Constructors Constructor Description RequestContext(RequestScope requestScope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)
void
destroyOne(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)
<U> U
findOrCreate(org.glassfish.hk2.api.ActiveDescriptor<U> activeDescriptor, org.glassfish.hk2.api.ServiceHandle<?> root)
java.lang.Class<? extends java.lang.annotation.Annotation>
getScope()
boolean
isActive()
void
shutdown()
boolean
supportsNullCreation()
-
-
-
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:
getScope
in 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:
findOrCreate
in interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
containsKey
public boolean containsKey(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)
- Specified by:
containsKey
in interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
supportsNullCreation
public boolean supportsNullCreation()
- Specified by:
supportsNullCreation
in interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
destroyOne
public void destroyOne(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)
- Specified by:
destroyOne
in interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfaceorg.glassfish.hk2.api.Context<RequestScoped>
-
-