Class AbstractContext

    • Constructor Detail

      • AbstractContext

        public AbstractContext()
    • Method Detail

      • getContextualStorage

        protected abstract ContextualStorage getContextualStorage​(javax.enterprise.context.spi.Contextual<?> contextual,
                                                                  boolean createIfNotExist)
        An implementation has to return the underlying storage which contains the items held in the Context.
        Parameters:
        contextual - the contextual type
        createIfNotExist - whether a ContextualStorage shall get created if it doesn't yet exist.
        Returns:
        the underlying storage
      • getActiveContextualStorages

        protected List<ContextualStorage> getActiveContextualStorages()
        Gets all active contextual storages.
        Returns:
        a list of contextual storages.
      • get

        public <T> T get​(javax.enterprise.context.spi.Contextual<T> bean)
        Specified by:
        get in interface javax.enterprise.context.spi.Context
      • get

        public <T> T get​(javax.enterprise.context.spi.Contextual<T> bean,
                         javax.enterprise.context.spi.CreationalContext<T> creationalContext)
        Specified by:
        get in interface javax.enterprise.context.spi.Context
      • destroy

        public void destroy​(javax.enterprise.context.spi.Contextual<?> bean)
        Destroy the Contextual Instance of the given Bean.
        Specified by:
        destroy in interface javax.enterprise.context.spi.AlterableContext
        Parameters:
        bean - dictates which bean shall get cleaned up
      • destroyAllActive

        public static Map<Object,​ContextualInstanceInfo<?>> destroyAllActive​(ContextualStorage storage)
        Destroys all the Contextual Instances in the specified ContextualStorage. This is a static method to allow various holder objects to cleanup properly in @PreDestroy.
        Parameters:
        storage - a contextual storage
        Returns:
        a storage map of destroyed objects
      • destroy

        public void destroy()
        Specified by:
        destroy in interface io.quarkus.arc.InjectableContext
      • getState

        public io.quarkus.arc.InjectableContext.ContextState getState()
        Specified by:
        getState in interface io.quarkus.arc.InjectableContext
      • checkActive

        protected void checkActive()
        Make sure that the Context is really active.
        Throws:
        javax.enterprise.context.ContextNotActiveException - if there is no active Context for the current Thread.
      • destroyBean

        public static void destroyBean​(javax.enterprise.context.spi.Contextual bean,
                                       ContextualInstanceInfo<?> contextualInstanceInfo)