Class RequestContext

java.lang.Object
org.glassfish.jersey.inject.hk2.RequestContext
All Implemented Interfaces:
org.glassfish.hk2.api.Context<RequestScoped>

@Singleton public class RequestContext extends Object implements org.glassfish.hk2.api.Context<RequestScoped>
Class is able to communicate with RequestScope and provide request-scoped descriptors to HK2 DI provider to create or destroy instances.
  • Field Details

  • Constructor Details

    • RequestContext

      @Inject public RequestContext(RequestScope requestScope)
  • Method Details

    • getScope

      public Class<? extends Annotation> getScope()
      Specified by:
      getScope in interface org.glassfish.hk2.api.Context<RequestScoped>
    • findOrCreate

      public <U> U findOrCreate(org.glassfish.hk2.api.ActiveDescriptor<U> activeDescriptor, org.glassfish.hk2.api.ServiceHandle<?> root)
      Specified by:
      findOrCreate in interface org.glassfish.hk2.api.Context<RequestScoped>
    • containsKey

      public boolean containsKey(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)
      Specified by:
      containsKey in interface org.glassfish.hk2.api.Context<RequestScoped>
    • supportsNullCreation

      public boolean supportsNullCreation()
      Specified by:
      supportsNullCreation in interface org.glassfish.hk2.api.Context<RequestScoped>
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface org.glassfish.hk2.api.Context<RequestScoped>
    • destroyOne

      public void destroyOne(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)
      Specified by:
      destroyOne in interface org.glassfish.hk2.api.Context<RequestScoped>
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface org.glassfish.hk2.api.Context<RequestScoped>