Class NonContextual<T>

  • Type Parameters:
    T -

    public class NonContextual<T>
    extends Object
    Manages lifecycle of non-contextual (non-CDI-managed) objects
    Author:
    igor
    • Method Detail

      • undeploy

        public static void undeploy()
        Undeploys the looked up bean manager from cache
      • of

        public static <T> NonContextual<T> of​(T t)
        Convenience factory method for an instance, see of(Class).
        Type Parameters:
        T -
        Parameters:
        t -
        Returns:
        The NonContextual for the instance's class
      • of

        public static <T> NonContextual<T> of​(Class<? extends T> clazz)
        Factory method for creating non-contextual instances
        Type Parameters:
        T -
        Parameters:
        clazz -
        Returns:
        The NonContextual for the given class
      • postConstruct

        public void postConstruct​(T instance)
        Injects the instance and calls any PostConstruct methods
        Parameters:
        instance -
      • inject

        public void inject​(T instance)
        Injects the instance
        Parameters:
        instance -
      • preDestroy

        public void preDestroy​(T instance)
        Calls any PreDestroy methods and destroys any injected dependencies that need to be destroyed.
        Parameters:
        instance -