Class InjectionManagerImpl<T>

  • All Implemented Interfaces:
    InjectionManager<T>

    public class InjectionManagerImpl<T>
    extends java.lang.Object
    implements InjectionManager<T>
    Manages calls to CDI to inject into managed beans This class will be created reflectively to avoid dependencies on CDI classes in environments that do not support CDI
    • Field Detail

      • beanManager

        protected javax.enterprise.inject.spi.BeanManager beanManager
      • creationalContext

        protected javax.enterprise.context.spi.CreationalContext<T> creationalContext
      • injectionTargets

        protected final java.util.Map<T,​javax.enterprise.inject.spi.InjectionTarget<T>> injectionTargets
    • Constructor Detail

      • InjectionManagerImpl

        public InjectionManagerImpl​(java.lang.Object beanManagerInstance)
                             throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException
    • Method Detail

      • createManagedBeanAndInjectDependencies

        public T createManagedBeanAndInjectDependencies​(java.lang.Class<T> managedBeanClass)
                                                 throws javax.naming.NamingException
        Creates an instance of the CDI managed bean. Calls CDI API to inject into the bean.
        Specified by:
        createManagedBeanAndInjectDependencies in interface InjectionManager<T>
        Parameters:
        managedBeanClass - bean class to be instantiated.
        Returns:
        New instance of bean class with injected content.
        Throws:
        javax.naming.NamingException