Class RequestContext

  • All Implemented Interfaces:
    org.glassfish.hk2.api.Context<RequestScoped>

    @Singleton
    public class RequestContext
    extends java.lang.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.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  RequestContext.Binder
      Request scope injection binder.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsKey​(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)  
      void destroyOne​(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor)  
      <U> U findOrCreate​(org.glassfish.hk2.api.ActiveDescriptor<U> activeDescriptor, org.glassfish.hk2.api.ServiceHandle<?> root)  
      java.lang.Class<? extends java.lang.annotation.Annotation> getScope()  
      boolean isActive()  
      void shutdown()  
      boolean supportsNullCreation()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RequestContext

        @Inject
        public RequestContext​(RequestScope requestScope)
    • Method Detail

      • getScope

        public java.lang.Class<? extends java.lang.annotation.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>