Class AbstractContext

    • Constructor Detail

      • AbstractContext

        public AbstractContext​(String contextId,
                               boolean multithreaded)
        Constructor
    • Method Detail

      • get

        public <T> T get​(Contextual<T> contextual,
                         CreationalContext<T> creationalContext)
        Get the bean if it exists in the contexts.
        Specified by:
        get in interface Context
        Type Parameters:
        T - the type of contextual type
        Parameters:
        contextual - the contextual type
        creationalContext - the context in which the new instance will be created
        Returns:
        An instance of the bean
        Throws:
        ContextNotActiveException - if the context is not active
      • get

        public <T> T get​(Contextual<T> contextual)
        Description copied from interface: Context
        Return an existing instance of a certain contextual type or a null value.
        Specified by:
        get in interface Context
        Type Parameters:
        T - the type of the contextual type
        Parameters:
        contextual - the contextual type
        Returns:
        the contextual instance, or a null value
      • destroy

        public void destroy​(Contextual<?> contextual)
        Description copied from interface: AlterableContext

        Destroy the existing contextual instance. If there is no existing instance, no action is taken.

        Specified by:
        destroy in interface AlterableContext
        Parameters:
        contextual - the contextual type
      • destroy

        protected void destroy()
        Destroys the context
      • getBeanStore

        protected abstract BeanStore getBeanStore()
        A method that returns the actual bean store implementation
        Returns:
        The bean store
      • cleanup

        public void cleanup()
      • getId

        protected org.jboss.weld.serialization.spi.BeanIdentifier getId​(Contextual<?> contextual)
      • getServiceRegistry

        protected org.jboss.weld.bootstrap.api.ServiceRegistry getServiceRegistry()
      • checkContextInitialized

        protected void checkContextInitialized()
        Allows contexts that are initialized lazily to plug in additional logic.
      • isMultithreaded

        protected boolean isMultithreaded()