Class CDIContextBridge

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

    @Singleton
    public class CDIContextBridge
    extends Object
    implements org.glassfish.hk2.api.Context<CDIScope>
    This is an HK2 context for use with descriptors that are backed by CDI services (which are not Dependent or Singleton). This scope is most like PerLookup, as it always asks for a new instance. Whether or not CDI truly gives a new instance or not is up to CDI
    Author:
    jwells
    • Constructor Detail

      • CDIContextBridge

        public CDIContextBridge()
    • Method Detail

      • getScope

        public Class<? extends Annotation> getScope()
        Specified by:
        getScope in interface org.glassfish.hk2.api.Context<CDIScope>
      • 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<CDIScope>
      • containsKey

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

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

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

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

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