Package org.jboss.injection.injector.metadata

Examples of org.jboss.injection.injector.metadata.JndiEnvironmentRefsGroup


      // Let's first create EEInjector (which pulls from ENC and pushes to EJB instance) for EJB
      // and then create a EEInjector for each of the interceptors for the bean

      JBossEnterpriseBeanMetaData beanMetaData = ejbContainer.getXml();
      // convert JBMETA metadata to jboss-injection specific metadata
      JndiEnvironmentRefsGroup jndiEnvironment = new JndiEnvironmentImpl(beanMetaData, ejbContainer.getClassloader());
      // For optimization, we'll create an Injector only if there's atleast one InjectionTarget
      if (this.hasInjectionTargets(jndiEnvironment))
      {
         // create the injector
         EEInjector eeInjector = new EEInjector(jndiEnvironment);
         // add the injector the injection manager
         injectionManager.addInjector(eeInjector);
         // Deploy the Injector as a MC bean (so that the fully populated naming context (obtained via the SwitchBoard
         // Barrier) gets injected.
         String injectorMCBeanName = this.getInjectorMCBeanNamePrefix() + ",bean=" + ejbContainer.getEjbName();
         BeanMetaData injectorBMD = this.createInjectorBMD(injectorMCBeanName, eeInjector, switchBoard);
         this.jbossUnit.addAttachment(BeanMetaData.class + ":" + injectorMCBeanName, injectorBMD);
        
         // Add the Injector dependency on the deployment (so that the DU doesn't
         // get started till the Injector is available)
         DependencyPolicy dependsPolicy = ejbContainer.getDependencyPolicy();
         dependsPolicy.addDependency(injectorMCBeanName);
         log.debug("Added Injector dependency: " + injectorMCBeanName + " for EJB: " + ejbContainer.getEjbName() + " in unit " + this.jbossUnit);
      }
     
      // Now setup injectors for the interceptors of the bean
      InterceptorsMetaData interceptors = JBossMetaData.getInterceptors(beanMetaData.getEjbName(), beanMetaData.getJBossMetaData());
      if (interceptors == null || interceptors.isEmpty())
      {
         return;
      }
      for (InterceptorMetaData interceptor : interceptors)
      {
         if (interceptor == null)
         {
            continue;
         }
         JndiEnvironmentRefsGroup jndiEnvironmentForInterceptor = new JndiEnvironmentImpl(interceptor, ejbContainer.getClassloader());
         // For optimization, we'll create an Injector only if there's atleast one InjectionTarget
         if (this.hasInjectionTargets(jndiEnvironmentForInterceptor))
         {
            // create the injector
            EEInjector lazyEEInjector = new EEInjector(jndiEnvironmentForInterceptor);
View Full Code Here


            // Setup the Injector
            Environment webEnvironment = metaData.getJndiEnvironmentRefsGroup();
            if (webEnvironment != null)
            {
               // convert JBMETA metadata to jboss-injection specific metadata
               JndiEnvironmentRefsGroup jndiEnvironment = new JndiEnvironmentImpl(webEnvironment, unit.getClassLoader());
               // For optimization, we'll create an Injector only if there's atleast one InjectionTarget
               if (this.hasInjectionTargets(jndiEnvironment))
               {
                  // create the injector
                  EEInjector eeInjector = new EEInjector(jndiEnvironment);
View Full Code Here

      // Let's first create EEInjector (which pulls from ENC and pushes to EJB instance) for EJB
      // and then create a EEInjector for each of the interceptors for the bean

      JBossEnterpriseBeanMetaData beanMetaData = container.getXml();
      // convert JBMETA metadata to jboss-injection specific metadata
      JndiEnvironmentRefsGroup jndiEnvironment = new JndiEnvironmentImpl(beanMetaData, container.getClassloader());
      // For optimization, we'll create an Injector only if there's atleast one InjectionTarget
      if (this.hasInjectionTargets(jndiEnvironment))
      {
         // create the injector
         EEInjector eeInjector = new EEInjector(jndiEnvironment);
         // add the injector the injection manager
         injectionManager.addInjector(eeInjector);
         // Deploy the Injector as a MC bean (so that the fully populated naming context (obtained via the SwitchBoard
         // Barrier) gets injected.
         String injectorMCBeanName = this.getInjectorMCBeanNamePrefix(unit) + ",bean=" + container.getEjbName();
         BeanMetaData injectorBMD = this.createInjectorBMD(injectorMCBeanName, eeInjector, switchBoard);
         // add BMD to parent, since this is a component DU. and BMDDeployer doesn't pick up BMD from components!
         unit.getParent().addAttachment(BeanMetaData.class + ":" + injectorMCBeanName, injectorBMD);
        
         // Add the Injector dependency on the deployment (so that the DU doesn't
         // get started till the Injector is available)
         DependencyPolicy dependsPolicy = container.getDependencyPolicy();
         dependsPolicy.addDependency(injectorMCBeanName);
         log.debug("Added Injector dependency: " + injectorMCBeanName + " for EJB: " + container.getEjbName() + " in unit " + unit);
      }
     
      // Now setup injectors for the interceptors of the bean
      InterceptorsMetaData interceptors = JBossMetaData.getInterceptors(beanMetaData.getEjbName(), beanMetaData.getJBossMetaData());
      if (interceptors == null || interceptors.isEmpty())
      {
         return;
      }
      for (InterceptorMetaData interceptor : interceptors)
      {
         if (interceptor == null)
         {
            continue;
         }
         JndiEnvironmentRefsGroup jndiEnvironmentForInterceptor = new JndiEnvironmentImpl(interceptor, container.getClassloader());
         // For optimization, we'll create an Injector only if there's atleast one InjectionTarget
         if (this.hasInjectionTargets(jndiEnvironmentForInterceptor))
         {
            // create the injector
            EEInjector eeInjector = new EEInjector(jndiEnvironmentForInterceptor);
View Full Code Here

      // Let's first create EEInjector (which pulls from ENC and pushes to EJB instance) for EJB
      // and then create a EEInjector for each of the interceptors for the bean

      JBossEnterpriseBeanMetaData beanMetaData = container.getXml();
      // convert JBMETA metadata to jboss-injection specific metadata
      JndiEnvironmentRefsGroup jndiEnvironment = new JndiEnvironmentImpl(beanMetaData, container.getClassloader());
      // For optimization, we'll create an Injector only if there's atleast one InjectionTarget
      if (this.hasInjectionTargets(jndiEnvironment))
      {
         // create the injector
         EEInjector eeInjector = new EEInjector(jndiEnvironment);
         // add the injector the injection manager
         injectionManager.addInjector(eeInjector);
         // Deploy the Injector as a MC bean (so that the fully populated naming context (obtained via the SwitchBoard
         // Barrier) gets injected.
         String injectorMCBeanName = this.getInjectorMCBeanNamePrefix(unit) + ",bean=" + container.getEjbName();
         BeanMetaData injectorBMD = this.createInjectorBMD(injectorMCBeanName, eeInjector, switchBoard);
         // add BMD to parent, since this is a component DU. and BMDDeployer doesn't pick up BMD from components!
         unit.getParent().addAttachment(BeanMetaData.class + ":" + injectorMCBeanName, injectorBMD);
        
         // Add the Injector dependency on the deployment (so that the DU doesn't
         // get started till the Injector is available)
         DependencyPolicy dependsPolicy = container.getDependencyPolicy();
         dependsPolicy.addDependency(injectorMCBeanName);
         log.debug("Added Injector dependency: " + injectorMCBeanName + " for EJB: " + container.getEjbName() + " in unit " + unit);
      }
     
      // Now setup injectors for the interceptors of the bean
      InterceptorsMetaData interceptors = JBossMetaData.getInterceptors(beanMetaData.getEjbName(), beanMetaData.getJBossMetaData());
      if (interceptors == null || interceptors.isEmpty())
      {
         return;
      }
      for (InterceptorMetaData interceptor : interceptors)
      {
         if (interceptor == null)
         {
            continue;
         }
         JndiEnvironmentRefsGroup jndiEnvironmentForInterceptor = new JndiEnvironmentImpl(interceptor, container.getClassloader());
         // For optimization, we'll create an Injector only if there's atleast one InjectionTarget
         if (this.hasInjectionTargets(jndiEnvironmentForInterceptor))
         {
            // create the injector
            EEInjector eeInjector = new EEInjector(jndiEnvironmentForInterceptor);
View Full Code Here

TOP

Related Classes of org.jboss.injection.injector.metadata.JndiEnvironmentRefsGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.