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, suspendCurrent
public RequestContext createContext()
RequestScope
request 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 RequestScope
protected void activate(RequestContext context, RequestContext oldContext)
RequestScope
RequestContext
to thread-local variable belonging to current request scope.activate
in class RequestScope
context
- storage with request scoped objects.protected void resume(RequestContext context)
RequestScope
RequestContext
to thread-local variable belonging to current request scope.resume
in class RequestScope
context
- storage with request scoped objects.protected void release(RequestContext context)
RequestScope
RequestContext
to thread-local variable belonging to current request scope.release
in class RequestScope
context
- storage with request scoped objects.protected void suspend(RequestContext context)
RequestScope
suspend
in class RequestScope
context
- current request context to be suspended.Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.