Class CdiRequestScope

java.lang.Object
org.glassfish.jersey.process.internal.RequestScope
org.glassfish.jersey.inject.cdi.se.CdiRequestScope

public class CdiRequestScope extends RequestScope
CDI Request scope implementation using Weld-specific BoundRequestContext which allows pass on storage for request-scoped objects.
  • Constructor Details

    • CdiRequestScope

      public CdiRequestScope()
  • Method Details

    • createContext

      public RequestContext createContext()
      Description copied from class: RequestScope
      Creates a new instance of the 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();
       
      Specified by:
      createContext in class RequestScope
      Returns:
      New suspended request scope context.
    • activate

      protected void activate(RequestContext context, RequestContext oldContext)
      Description copied from class: RequestScope
      Stores the provided RequestContext to thread-local variable belonging to current request scope.
      Overrides:
      activate in class RequestScope
      Parameters:
      context - storage with request scoped objects.
    • resume

      protected void resume(RequestContext context)
      Description copied from class: RequestScope
      Resumes the provided RequestContext to thread-local variable belonging to current request scope.
      Overrides:
      resume in class RequestScope
      Parameters:
      context - storage with request scoped objects.
    • release

      protected void release(RequestContext context)
      Description copied from class: RequestScope
      Releases the provided RequestContext to thread-local variable belonging to current request scope.
      Overrides:
      release in class RequestScope
      Parameters:
      context - storage with request scoped objects.
    • suspend

      protected void suspend(RequestContext context)
      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 class RequestScope
      Parameters:
      context - current request context to be suspended.