Package org.jboss.ejb3

Examples of org.jboss.ejb3.DeploymentScope


      stateful.setState("state");
      stateful.removeMe();
     
      ObjectName deployment = new ObjectName("test.ejb3:name=Bill,service=EJB3");

      ClientKernelAbstraction kernel = KernelAbstractionFactory.getClientInstance();
      kernel.invoke(deployment, "stop", new Object[0], new String[0]);
      kernel.invoke(deployment, "start", new Object[0], new String[0]);
     
      stateful = (Stateful)getInitialContext().lookup("Stateful");
      assertNotNull(stateful);
      stateful.setState("state");
      stateful.removeMe();
View Full Code Here


      {
         try
         {

            String guid = (String) statefulGuidField.get(ejbContext);
            Container container = Ejb3Registry.getContainer(guid);
            return container.getEjbName();
         }
         catch (IllegalArgumentException e)
         {
            throw new RuntimeException(e);
         }
View Full Code Here

         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);
            // add the injector the injection manager
            injectionManager.addInjector(lazyEEInjector);
            // Deploy the Injector as a MC bean (so that the fully populated naming context (obtained via the SwitchBoard
            // Barrier) gets injected.
            String interceptorInjectorMCBeanName = this.getInjectorMCBeanNamePrefix() + ",bean=" + ejbContainer.getEjbName() + ",interceptor=" + interceptor.getName();
            BeanMetaData injectorBMD = this.createInjectorBMD(interceptorInjectorMCBeanName, lazyEEInjector, switchBoard);
            this.jbossUnit.addAttachment(BeanMetaData.class + ":" + interceptorInjectorMCBeanName, 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(interceptorInjectorMCBeanName);
            log.debug("Added Injector dependency: " + interceptorInjectorMCBeanName + " for interceptor "
                  + interceptor.getName() + " of EJB: " + ejbContainer.getEjbName() + " in unit " + this.jbossUnit);
         }
        
      }
View Full Code Here

      summary.setEjbName(container.getEjbName());
      summary.setService(container instanceof ServiceContainer);
      summary.setStateful(container instanceof StatefulContainer);
      summary.setDeploymentName(container.getDeployment().getName());
      summary.setBeanClassName(container.getBeanClass().getName());
      DeploymentScope scope = container.getDeployment().getEar();
      if (scope != null)
      {
         summary.setDeploymentScopeBaseName(scope.getBaseName());
      }

      // Return
      return summary;
   }
View Full Code Here

            return;
         }
           
         log.debug("********* " + this.getClass().getSimpleName() + " Begin Unit: " + unit.getSimpleName() + " jar: "
               + jar.getName());
         DeploymentScope scope = null;
         VFSDeploymentUnit parent = unit.getParent();
         if (parent != null && parent.getSimpleName().endsWith(".ear")) // todo should look for metadata instead of ".ear"
         {
            scope = parent.getAttachment(DeploymentScope.class);
            if (scope == null)
            {
               scope = new JBoss5DeploymentScope(unit.getParent());
               parent.addAttachment(DeploymentScope.class, scope);
            }
         }
         JBoss5DeploymentUnit du = new JBoss5DeploymentUnit(unit);
         du.setDefaultPersistenceProperties(defaultPersistenceProperties);
         Ejb3JBoss5Deployment deployment = new Ejb3JBoss5Deployment(du, kernel, mbeanServer, unit, scope, metaData, persistenceUnitsMetaData,
               this);
         if (scope != null) scope.register(deployment);
         // create() creates initial EJB containers and initializes metadata.
         deployment.create();
         if (deployment.getEjbContainers().size() == 0 && deployment.getPersistenceUnitDeployments().size() == 0)
         {
            log.trace("Found no containers in scanned jar, consider adding it to the ignore list: " + jar.getName() + " url: " + jar.toURL() + " unit: " + unit.getSimpleName());
View Full Code Here

                  + "\" - either EJB3 Deployment Descriptor or \"jboss.xml\" is required and neither were found.");
            return;
         }
           
         log.debug("********* EJBRegistrationDepoyer Begin Unit: " + unit.getSimpleName() + " jar: " + jar.getName());
         DeploymentScope scope = null;
         VFSDeploymentUnit parent = unit.getParent();
         if (parent != null && parent.getSimpleName().endsWith(".ear")) // todo should look for metadata instead of ".ear"
         {
            scope = parent.getAttachment(DeploymentScope.class);
            if (scope == null)
            {
               scope = new JBoss5DeploymentScope(unit.getParent());
               parent.addAttachment(DeploymentScope.class, scope);
            }
         }
         JBoss5DeploymentUnit du = new JBoss5DeploymentUnit(unit);
         du.setDefaultPersistenceProperties(defaultPersistenceProperties);
         Ejb3JBoss5Deployment deployment = new Ejb3JBoss5Deployment(du, kernel, mbeanServer, unit, scope, null, null, null);
         if (scope != null) scope.register(deployment);
         // create() creates initial EJB containers and initializes metadata.
         deployment.create();
         if (deployment.getEjbContainers().size() == 0 && deployment.getPersistenceUnitDeployments().size() == 0)
         {
            log.trace("EJBRegistrationDeployer no containers in scanned jar, consider adding it to the ignore list: " + jar.getName() + " url: " + jar.toURL() + " unit: " + unit.getSimpleName());
View Full Code Here

      summary.setEjbName(container.getEjbName());
      summary.setService(container instanceof ServiceContainer);
      summary.setStateful(container instanceof StatefulContainer);
      summary.setDeploymentName(container.getDeployment().getName());
      summary.setBeanClassName(container.getBeanClass().getName());
      DeploymentScope scope = container.getDeployment().getEar();
      if (scope != null)
      {
         summary.setDeploymentScopeBaseName(scope.getBaseName());
      }

      // Return
      return summary;
   }
View Full Code Here

/*     */
/* 177 */         return;
/*     */       }
/*     */
/* 180 */       log.debug("********* EJBRegistrationDepoyer Begin Unit: " + unit.getSimpleName() + " jar: " + jar.getName());
/* 181 */       DeploymentScope scope = null;
/* 182 */       VFSDeploymentUnit parent = unit.getParent();
/* 183 */       if ((parent != null) && (parent.getSimpleName().endsWith(".ear")))
/*     */       {
/* 185 */         scope = (DeploymentScope)parent.getAttachment(DeploymentScope.class);
/* 186 */         if (scope == null)
/*     */         {
/* 188 */           scope = new JBoss5DeploymentScope(unit.getParent());
/* 189 */           parent.addAttachment(DeploymentScope.class, scope);
/*     */         }
/*     */       }
/* 192 */       JBoss5DeploymentUnit du = new JBoss5DeploymentUnit(unit);
/* 193 */       du.setDefaultPersistenceProperties(this.defaultPersistenceProperties);
/* 194 */       Ejb3JBoss5Deployment deployment = new Ejb3JBoss5Deployment(du, this.kernel, this.mbeanServer, unit, scope, null, null, null);
/* 195 */       if (scope != null) scope.register(deployment);
/*     */
/* 197 */       deployment.create();
/* 198 */       if ((deployment.getEjbContainers().size() == 0) && (deployment.getPersistenceUnitDeployments().size() == 0))
/*     */       {
/* 200 */         log.trace("EJBRegistrationDeployer no containers in scanned jar, consider adding it to the ignore list: " + jar.getName() + " url: " + jar.toURL() + " unit: " + unit.getSimpleName());
View Full Code Here

/* 123 */         return;
/*     */       }
/*     */
/* 126 */       this.log.debug("********* " + getClass().getSimpleName() + " Begin Unit: " + unit.getSimpleName() + " jar: " + jar.getName());
/*     */
/* 128 */       DeploymentScope scope = null;
/* 129 */       VFSDeploymentUnit parent = unit.getParent();
/* 130 */       if ((parent != null) && (parent.getSimpleName().endsWith(".ear")))
/*     */       {
/* 132 */         scope = (DeploymentScope)parent.getAttachment(DeploymentScope.class);
/* 133 */         if (scope == null)
/*     */         {
/* 135 */           scope = new JBoss5DeploymentScope(unit.getParent());
/* 136 */           parent.addAttachment(DeploymentScope.class, scope);
/*     */         }
/*     */       }
/* 139 */       JBoss5DeploymentUnit du = new JBoss5DeploymentUnit(unit);
/* 140 */       du.setDefaultPersistenceProperties(this.defaultPersistenceProperties);
/* 141 */       Ejb3JBoss5Deployment deployment = new Ejb3JBoss5Deployment(du, this.kernel, this.mbeanServer, unit, scope, metaData, persistenceUnitsMetaData, this);
/*     */
/* 143 */       if (scope != null) scope.register(deployment);
/*     */
/* 145 */       deployment.create();
/* 146 */       if ((deployment.getEjbContainers().size() == 0) && (deployment.getPersistenceUnitDeployments().size() == 0))
/*     */       {
/* 148 */         this.log.trace("Found no containers in scanned jar, consider adding it to the ignore list: " + jar.getName() + " url: " + jar.toURL() + " unit: " + unit.getSimpleName());
View Full Code Here

      summary.setEjbName(container.getEjbName());
      summary.setService(container instanceof ServiceContainer);
      summary.setStateful(container instanceof StatefulContainer);
      summary.setDeploymentName(container.getDeployment().getName());
      summary.setBeanClassName(container.getBeanClass().getName());
      DeploymentScope scope = container.getDeployment().getEar();
      if (scope != null)
      {
         summary.setDeploymentScopeBaseName(scope.getBaseName());
      }

      // Return
      return summary;
   }
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.DeploymentScope

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.