public class CdiRequestScope extends RequestScope
BoundRequestContext which allows pass on storage for
request-scoped objects.RequestScope.RequestScopeConfigurator| Constructor and Description |
|---|
CdiRequestScope() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(RequestContext context,
RequestContext oldContext)
Stores the provided
RequestContext to thread-local variable belonging to current request scope. |
RequestContext |
createContext()
Creates a new instance of the
request scope context. |
protected void |
release(RequestContext context)
Releases the provided
RequestContext to thread-local variable belonging to current request scope. |
protected void |
resume(RequestContext context)
Resumes the provided
RequestContext 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.
|
current, isActive, referenceCurrent, runInScope, runInScope, runInScope, runInScope, runInScope, runInScope, shutdown, suspendCurrentpublic RequestContext createContext()
RequestScoperequest 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();
createContext in class RequestScopeprotected void activate(RequestContext context, RequestContext oldContext)
RequestScopeRequestContext to thread-local variable belonging to current request scope.activate in class RequestScopecontext - storage with request scoped objects.protected void resume(RequestContext context)
RequestScopeRequestContext to thread-local variable belonging to current request scope.resume in class RequestScopecontext - storage with request scoped objects.protected void release(RequestContext context)
RequestScopeRequestContext to thread-local variable belonging to current request scope.release in class RequestScopecontext - storage with request scoped objects.protected void suspend(RequestContext context)
RequestScopesuspend in class RequestScopecontext - current request context to be suspended.Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.