Class CdiRequestScope
java.lang.Object
org.glassfish.jersey.process.internal.RequestScope
org.glassfish.jersey.inject.cdi.se.CdiRequestScope
CDI Request scope implementation using Weld-specific
BoundRequestContext
which allows pass on storage for
request-scoped objects.-
Nested Class Summary
Nested classes/interfaces inherited from class org.glassfish.jersey.process.internal.RequestScope
RequestScope.RequestScopeConfigurator
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
activate
(RequestContext context, RequestContext oldContext) Stores the providedRequestContext
to thread-local variable belonging to current request scope.Creates a new instance of therequest scope context
.protected void
release
(RequestContext context) Releases the providedRequestContext
to thread-local variable belonging to current request scope.protected void
resume
(RequestContext context) Resumes the providedRequestContext
to thread-local variable belonging to current request scope.protected void
suspend
(RequestContext context) Executes the action when the request scope comes into suspended state.Methods inherited from class org.glassfish.jersey.process.internal.RequestScope
current, isActive, referenceCurrent, runInScope, runInScope, runInScope, runInScope, runInScope, runInScope, shutdown, suspendCurrent
-
Constructor Details
-
CdiRequestScope
public CdiRequestScope()
-
-
Method Details
-
createContext
Description copied from class:RequestScope
Creates a new instance of therequest scope context
. This instance can be then used to run task in the request scope. Returned context is suspended by default and must therefore be closed explicitly as it is shown in the following example:RequestContext context = requestScope.createContext(); requestScope.runInScope(context, someRunnableTask); context.release();
- Specified by:
createContext
in classRequestScope
- Returns:
- New suspended request scope context.
-
activate
Description copied from class:RequestScope
Stores the providedRequestContext
to thread-local variable belonging to current request scope.- Overrides:
activate
in classRequestScope
- Parameters:
context
- storage with request scoped objects.
-
resume
Description copied from class:RequestScope
Resumes the providedRequestContext
to thread-local variable belonging to current request scope.- Overrides:
resume
in classRequestScope
- Parameters:
context
- storage with request scoped objects.
-
release
Description copied from class:RequestScope
Releases the providedRequestContext
to thread-local variable belonging to current request scope.- Overrides:
release
in classRequestScope
- Parameters:
context
- storage with request scoped objects.
-
suspend
Description copied from class:RequestScope
Executes the action when the request scope comes into suspended state. For example, implementation can call deactivation of the underlying request scope storage.- Overrides:
suspend
in classRequestScope
- Parameters:
context
- current request context to be suspended.
-