Package org.jboss.deployers.structure.spi

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


   }

   private List<String> getEjbDeploymentPaths(DeploymentUnit unit)
   {
      ArrayList<String> paths = new ArrayList<String>();
      DeploymentUnit root = unit.getTopLevel();
      getEjbDeploymentPaths(root, paths);
      return paths;
   }
View Full Code Here


      return dSummary;
   }
  
   private void dump(DeploymentUnit unit)
   {
      DeploymentUnit top = unit.getTopLevel();
      StringBuffer tmp = new StringBuffer();
      dump(top, tmp, 0);
      log.debug("Processing unit="+unit.getSimpleName()+", structure:\n"+tmp);
   }
View Full Code Here

     
      // Create a merged view
      JBossMetaData mergedMetaData = new JBossMetaData();
      mergedMetaData.merge(metaData, specMetaData);
      // Incorporate any ear level overrides
      DeploymentUnit topUnit = unit.getTopLevel();
      if(topUnit != null && topUnit.getAttachment(JBossAppMetaData.class) != null)
      {
         JBossAppMetaData earMetaData = topUnit.getAttachment(JBossAppMetaData.class);
         // Security domain
         String securityDomain = earMetaData.getSecurityDomain();
         if(securityDomain != null && mergedMetaData.getSecurityDomain() == null)
            mergedMetaData.setSecurityDomain(securityDomain);
         //Security Roles
View Full Code Here

         }
      }
     
      // Enforce EAR rules from EE 6 EE.8.1.1
      JBossAppMetaData appMetaData = null;
      DeploymentUnit parent = unit.getParent();
      if (parent != null)
      {
         appMetaData = parent.getAttachment(JBossAppMetaData.class);
      }     
      if (appMetaData != null)
      {        
         moduleName = establishUniqueModuleName(unit, moduleName, appMetaData);
      }
View Full Code Here

      mainDeployer.addDeployment(deployment);
      mainDeployer.process();
      ControllerContext wbContext = null;
      try
      {
         DeploymentUnit earDU = getMainDeployerStructure().getDeploymentUnit(deployment.getName());
         String bootName = DeployersUtils.getBootstrapBeanName(earDU);
         bootstrap = getBean(bootName, null);
         assertInstanceOf(bootstrap, "org.jboss.test.deployers.support.CheckableBootstrap", earDU.getClassLoader());
         // waiting on ejb
         assertTrue(invoke(bootstrap, "Create"));
         assertFalse(invoke(bootstrap, "Boot")); // not yet booted
         assertFalse(invoke(bootstrap, "Shutdown"));
         // install ejb
         KernelControllerContext ejb = deploy(new AbstractBeanMetaData("EjbContainer#1", Object.class.getName()));
         try
         {
            assertTrue(ejb.getState().equals(ControllerState.INSTALLED));
            /// check boot
            assertTrue(invoke(bootstrap, "Create"));
            assertTrue(invoke(bootstrap, "Boot"));
            assertFalse(invoke(bootstrap, "Shutdown"));

            // test jndi binding
            duSimpleName = earDU.getSimpleName();
            Context context = assertInstanceOf(bmContext.lookup(duSimpleName), Context.class, false);
            assertSame("Bootstrap Dummy", context.lookup("bootstrap"));

            Class<?> wbClass = earDU.getClassLoader().loadClass("org.jboss.test.deployers.support.CheckableBootstrap");
            wbContext = controller.getContextByClass(wbClass);
            assertNotNull(wbContext);
            assertSame(bootstrap, wbContext.getTarget());
         }
         finally
View Full Code Here

         return resolveRelativeLink(di, link, searched, isLocal);
      }
      else
      {
         // <ejb-link> contains a Bean Name, scan the DeploymentUnit tree
         DeploymentUnit top = di.getTopLevel();
         return resolveAbsoluteLink(top, link, searched, isLocal);
      }
   }
View Full Code Here

      }
   }

   private static String resolveRelativeLink(DeploymentUnit unit, String link, ArrayList<String> searched, boolean isLocal)
   {
      DeploymentUnit top = unit.getTopLevel();
      String path = link.substring(0, link.indexOf('#'));
      String ejbName = link.substring(link.indexOf('#') + 1);

     
      if (log.isTraceEnabled())
      {
         log.trace("Resolving relative link: " + link);
      }
      DeploymentUnit targetUnit = findLinkPath(top, path);
      if (targetUnit == null)
      {
         log.warn("Can't locate DeploymentUnit for target: " + path);
         return null;
      }

      String linkTarget = null;
      if (targetUnit.getAttachment(JBossMetaData.class) != null)
      {
         JBossMetaData appMD = targetUnit.getAttachment(JBossMetaData.class);
         JBossEnterpriseBeanMetaData beanMD = appMD.getEnterpriseBean(ejbName);

         if (beanMD != null)
         {
            linkTarget = getJndiName(beanMD, isLocal);
            if (linkTarget == null)
            {
               if (isLocal)
                  log.warn("Unable to determine local jndi name for " + beanMD.getEjbName());
               else
                  log.warn("Unable to determine jndi name for " + beanMD.getEjbName());
               searched.add(beanMD.getEjbName());
            }
         }
         else
         {
            log.warn("No Bean named '" + ejbName + "' found in '" + path + "'!");
            for (JBossEnterpriseBeanMetaData md : appMD.getEnterpriseBeans())
               searched.add(md.getEjbName());
         }
      }
      else
      {
         log.warn("DeploymentUnit " + targetUnit + " is not an EJB .jar " + "file!");
         searched.add(targetUnit.getName());
      }

      return linkTarget;
   }
View Full Code Here

   }

   private static <T> List<T> getAllAttachments(DeploymentUnit unit, Class<T> type)
   {
      ArrayList<T> attachments = new ArrayList<T>();
      DeploymentUnit top = unit.getTopLevel();
      getAllAttachments(top, type, attachments);
      return attachments;
   }
View Full Code Here

         // link is specified in the form path/file.jar#Bean
         return resolveRelativeMessageDestination(di, link, searched);
      else
      {
         // link contains a Bean Name, scan the DeploymentUnit tree
         DeploymentUnit top = di.getTopLevel();
         return resolveAbsoluteMessageDestination(top, link, searched);
      }
   }
View Full Code Here

      if (log.isTraceEnabled())
      {
         log.trace("Resolving relative message-destination-link: " + link);
      }
      DeploymentUnit top = unit.getTopLevel();
      DeploymentUnit targetUnit = findLinkPath(top, path);
      if (targetUnit == null)
      {
         log.warn("Can't locate DeploymentUnit for target: " + path);
         return null;
      }

      if (log.isTraceEnabled())
         log.trace("Found appropriate DeploymentUnit: " + targetUnit);

      MessageDestinationMetaData md = null;
      MessageDestinationsMetaData mds = null;
      if (targetUnit.getAttachment(JBossMetaData.class) != null)
      {
         JBossMetaData appMD = targetUnit.getAttachment(JBossMetaData.class);
         mds = appMD.getAssemblyDescriptor().getMessageDestinations();
         md = mds.get(destinationName);
      }
      if (targetUnit.getAttachment(JBossWebMetaData.class) != null)
      {
         JBossWebMetaData webMD = targetUnit.getAttachment(JBossWebMetaData.class);
         mds = webMD.getMessageDestinations();
         md = mds.get(destinationName);
      }

      if(md == 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.