Package org.jboss.deployers.structure.spi

Examples of org.jboss.deployers.structure.spi.DeploymentUnit


      ear.addModule(ejbJar);
      // simple.war
      WebArchive war = createWar(true);
      ear.addModule(war);
      MockArchiveManifest.addManifest(ear);
      DeploymentUnit unit = assertDeploy(ear);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, unit);
      Iterator<DeploymentUnit> iterator = unit.getChildren().iterator();
      DeploymentUnit warUnit = null;
      do
      {
         warUnit = iterator.next();
      } while (!warUnit.getName().contains(WAR_NAME));
     
      Class<?> servletWebBeanClass = getClass(ServletWebBean.class, warUnit);
      Deployment deployment = initializeDeploymentBean();
     
     
View Full Code Here


      // ejb.jar
      EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, EAR_NAME);
      JavaArchive ejbJar = createEjbJar(true);
      ear.addModule(ejbJar);
      MockArchiveManifest.addManifest(ear);
      DeploymentUnit unit = assertDeploy(ear);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, unit);
      Deployment deployment1 = initializeDeploymentBean(unit);
      // simple.war
      WebArchive war = createWar(true);
      unit = assertDeploy(war);
View Full Code Here

      // ejb.ear
      EnterpriseArchive ejbEar = ShrinkWrap.create(EnterpriseArchive.class, "ejb.ear");
      JavaArchive ejbJar = createEjbJar(true);
      ejbEar.addModule(ejbJar);
      MockArchiveManifest.addManifest(ejbEar);
      DeploymentUnit unit = assertDeploy(ejbEar);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, unit);
      Deployment deployment1 = initializeDeploymentBean(unit);
      // war.ear
      EnterpriseArchive warEar = ShrinkWrap.create(EnterpriseArchive.class, "war.ear");
      WebArchive war = createWarWithLib(true, false);
      warEar.addModule(war);
      MockArchiveManifest.addManifest(warEar);
      unit = assertDeploy(warEar);
      DeploymentUnit warUnit = unit.getChildren().iterator().next();
      Class<?> servletWebBeanClass = getClass(ServletWebBean.class, warUnit);
      Class<?> uiWebBeanClass = getClass(UIWebBean.class, warUnit);
      Deployment deployment2 = initializeDeploymentBean(unit);
     
      // assertion deleted as loadBDA implementation does not check for unreachable classes anymore
View Full Code Here

   }
  
   public void testMultipleArchives() throws Exception
   {
      WebArchive war1 = createWar("web1.war", true, ServletWebBean.class);
      DeploymentUnit war1Unit = assertDeploy(war1);
      Deployment war1Deployment = initializeDeploymentBean(war1Unit);
      BeanDeploymentArchive war1BDA = war1Deployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(war1BDA, "web1.war");
      assertExpectedClasses(war1BDA, ServletWebBean.class);
      Class<?> servletWebBeanWar1Class = getClass(ServletWebBean.class, war1Unit);
     
      WebArchive war2 = createWar("web2.war", true, NotWBJsfBean.class);
      createLib(war2, "crm.jar", false, CrmWebBean.class);
      DeploymentUnit war2Unit = assertDeploy(war2);
      Deployment war2Deployment = initializeDeploymentBean(war2Unit);
      BeanDeploymentArchive war2BDA = war2Deployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(war2BDA, "web2.war");
      assertExpectedClasses(war2BDA, NotWBJsfBean.class);
      Class<?> notWBJsfBeanWar2Class = getClass(NotWBJsfBean.class, war2Unit);
      Class<?> crmWebBeanWar2Class = getClass(CrmWebBean.class, war2Unit);
     
      JavaArchive ejbJar = createEjbJar("ejb.jar", true, BusinessInterface.class);
      DeploymentUnit ejbJarUnit = assertDeploy(ejbJar);
      Deployment ejbJarDeployment = initializeDeploymentBean(ejbJarUnit);
      BeanDeploymentArchive ejbJarBDA = ejbJarDeployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(ejbJarBDA, "ejb.jar");
      assertExpectedClasses(ejbJarBDA, BusinessInterface.class);
      Class<?> businessInterfaceClass = getClass(BusinessInterface.class, ejbJarUnit);
     
      EnterpriseArchive ear1 = ShrinkWrap.create(EnterpriseArchive.class, "full.ear");
      WebArchive warInEar1 = createWarWithLibs(false, true, true);
      ear1.addModule(warInEar1);
      ear1.addModule(war2);
      JavaArchive ejbJarInEar1 = createEjbJar("ejbInFullEar.jar", false, MySLSBean.class);
      ear1.addModule(ejbJarInEar1);
      createLib(ear1, "lib1.jar", false, ExternalWebBean.class);
      createLib(ear1, "lib2.jar", true, A.class);
      createLib(ear1, "lib3.jar", false, B.class);
      MockArchiveManifest.addManifest(ear1);
      DeploymentUnit ear1Unit = assertDeploy(ear1);
      Deployment ear1Deployment = initializeDeploymentBean(ear1Unit);
      BeanDeploymentArchive ear1BDA = null, ear1War1BDA = null, ear1War2BDA = null;
      for (BeanDeploymentArchive bda: ear1Deployment.getBeanDeploymentArchives())
      {
         if (bda.getId().contains(WAR_NAME))
         {
            ear1War1BDA = bda;
         }
         else if (bda.getId().contains("web2.war"))
         {
            ear1War2BDA = bda;
         }
         else
         {
            ear1BDA = bda;
         }
      }
      assertBDAId(ear1BDA, "full.ear");
      assertExpectedClasses(ear1BDA, A.class);
      assertBDAId(ear1War1BDA, "full.ear/" + WAR_NAME);
      assertExpectedClasses(ear1War1BDA, UIWebBean.class, CrmWebBean.class);
      assertBDAId(ear1War2BDA, "full.ear/web2.war");
      assertExpectedClasses(ear1War2BDA, NotWBJsfBean.class);
      Class<?> servletWebBeanEar1Class = null, uiWebBeanEar1Class = null,
               crmWebBeanEar1War1Class = null, notWBJsfBeanEar1Class = null,
               crmWebBeanEar1War2Class = null;
      for (DeploymentUnit ear1Child: ear1Unit.getChildren())
      {
         if (ear1Child.getName().contains(WAR_NAME))
         {
           servletWebBeanEar1Class = getClass(ServletWebBean.class, ear1Child);
           uiWebBeanEar1Class = getClass(UIWebBean.class, ear1Child);
           crmWebBeanEar1War1Class = getClass(CrmWebBean.class, ear1Child);
         }
         else if (ear1Child.getName().contains("web2.war"))
         {
            notWBJsfBeanEar1Class = getClass(NotWBJsfBean.class, ear1Child);
            crmWebBeanEar1War2Class = getClass(CrmWebBean.class, ear1Child);
         }
      }
      Class<?> externalWebBeanClass = getClass(ExternalWebBean.class, ear1Unit);
      Class<?> aClass = getClass(A.class, ear1Unit);
      Class<?> bClass = getClass(B.class, ear1Unit);
     
      EnterpriseArchive ear2 = ShrinkWrap.create(EnterpriseArchive.class, "ejbWLibs.ear");
      JavaArchive ejbJarInEar2 = createEjbJar("ejbInEar2.jar", true, PlainJavaBean.class);
      ear2.addModule(ejbJarInEar2);
      createLib(ear2, "lib1.jar", false, SomeUtil.class);
      createLib(ear2, "lib2.jar", true, CrmWebBean.class);
      MockArchiveManifest.addManifest(ear2);
      DeploymentUnit ear2Unit = assertDeploy(ear2);
      Deployment ear2Deployment = initializeDeploymentBean(ear2Unit);
      BeanDeploymentArchive ear2BDA = ear2Deployment.getBeanDeploymentArchives().iterator().next();
      assertBDAId(ear2BDA, "ejbWLibs.ear");
      assertExpectedClasses(ear2BDA, PlainJavaBean.class, CrmWebBean.class);
      Class<?> plainJavaBeanClass = getClass(PlainJavaBean.class, ear2Unit);
View Full Code Here

      {
         // we support weld integration for JAXWS JSE endpoints only
         return;
      }

      final DeploymentUnit deploymentUnit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class);
      if (this.isWeldDeployment(deploymentUnit))
      {
         for (final Endpoint endpoint : dep.getService().getEndpoints())
         {
            endpoint.setInvocationHandler(new WeldInvocationHandler(endpoint.getInvocationHandler()));
View Full Code Here

    *
    * @param dep webservice deployment
    */
   void create(final Deployment dep)
   {
      final DeploymentUnit unit = WSHelper.getRequiredAttachment(dep, DeploymentUnit.class);
      JBossWebMetaData jbossWebMD = ASHelper.getOptionalAttachment(unit, JBossWebMetaData.class);
      if (jbossWebMD == null)
      {
         jbossWebMD = new JBossWebMetaData();
      }

      this.createWebAppDescriptor(dep, jbossWebMD);
      this.createJBossWebAppDescriptor(dep, jbossWebMD);

      dep.addAttachment(JBossWebMetaData.class, jbossWebMD);
      unit.addAttachment(JBossWebMetaData.class, jbossWebMD);
   }
View Full Code Here

   }

   @Override
   public void deploy(DeploymentUnit unit, PersistenceUnitMetaData deployment) throws DeploymentException
   {
      DeploymentUnit wrapper = wrap(unit);
      delegate.deploy(wrapper, deployment);
   }
View Full Code Here

      unit.addAttachment(JACC_ATTACHMENT_NAME, jaccPolicy, ServiceMetaData.class);
   }

   private ServiceMetaData getParentJaccPolicyBean(DeploymentUnit childDU)
   {
      DeploymentUnit parentDU = childDU.getParent();

      while (parentDU != null)
      {
         ServiceMetaData parentJacc = (ServiceMetaData) parentDU.getAttachment(JACC_ATTACHMENT_NAME);
         if (parentJacc != null)
            return parentJacc;
         parentDU = parentDU.getParent();
      }
      return null;
   }
View Full Code Here

    * archives
    */
   private String getObjectName(DeploymentUnit unit)
   {
      String deploymentName = unit.getName();
      DeploymentUnit parentDU = unit.getParent();
      String parentDeploymentName = parentDU != null ? ",parent=\"" + parentDU.getSimpleName() + "\"" : "";
      return BASE_OBJECT_NAME + "\"" + deploymentName + "\"" + parentDeploymentName;
   }
View Full Code Here

      DeployerClient mainDeployer = getDeployerClient();
      mainDeployer.addDeployment(deployment);
      mainDeployer.process();
      try
      {
         DeploymentUnit du = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
         ControllerContext context = du.getAttachment(ControllerContext.class);
         assertNotNull(context);
         assertEquals(ControllerState.INSTALLED, context.getState());

         // There should be no WB bootstrap bean
         assertNoBean(DeployersUtils.getBootstrapBeanName(du), null);
View Full Code Here

TOP

Related Classes of org.jboss.deployers.structure.spi.DeploymentUnit

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.