@Singleton public class RequestContext extends java.lang.Object implements org.glassfish.hk2.api.Context<RequestScoped>
RequestScope
and provide request-scoped descriptors to HK2 DI provider to create or
destroy instances.Modifier and Type | Class and Description |
---|---|
static class |
RequestContext.Binder
Request scope injection binder.
|
Modifier and Type | Field and Description |
---|---|
private RequestScope |
requestScope |
Constructor and Description |
---|
RequestContext(RequestScope requestScope) |
Modifier and Type | Method and 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() |
private final RequestScope requestScope
@Inject public RequestContext(RequestScope requestScope)
public java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
getScope
in interface org.glassfish.hk2.api.Context<RequestScoped>
public <U> U findOrCreate(org.glassfish.hk2.api.ActiveDescriptor<U> activeDescriptor, org.glassfish.hk2.api.ServiceHandle<?> root)
findOrCreate
in interface org.glassfish.hk2.api.Context<RequestScoped>
public boolean containsKey(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)
containsKey
in interface org.glassfish.hk2.api.Context<RequestScoped>
public boolean supportsNullCreation()
supportsNullCreation
in interface org.glassfish.hk2.api.Context<RequestScoped>
public boolean isActive()
isActive
in interface org.glassfish.hk2.api.Context<RequestScoped>
public void destroyOne(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)
destroyOne
in interface org.glassfish.hk2.api.Context<RequestScoped>
public void shutdown()
shutdown
in interface org.glassfish.hk2.api.Context<RequestScoped>