Package org.jboss.metadata.ear.spec

Examples of org.jboss.metadata.ear.spec.ModulesMetaData


        final EarMetaData earMetaData = parent.getAttachment(Attachments.EAR_METADATA);
        if(earMetaData == null) {
            return; // Nothing to see here
        }

        final ModulesMetaData modulesMetaData = earMetaData.getModules();
        if(modulesMetaData != null) for(ModuleMetaData moduleMetaData : modulesMetaData) {
            if(Web.equals(moduleMetaData.getType()) && moduleMetaData.getFileName().equals(deploymentRoot.getRootName())) {
                String contextRoot = WebModuleMetaData.class.cast(moduleMetaData.getValue()).getContextRoot();

                if(contextRoot == null && (warMetaData.getJBossWebMetaData() == null || warMetaData.getJBossWebMetaData().getContextRoot() == null)) {
View Full Code Here


   protected EarMetaData parse(VFSDeploymentUnit unit, VirtualFile file, EarMetaData root) throws Exception
   {
      EarMetaData ear = super.parse(unit,file, root);
      List<DeploymentUnit> children = unit.getChildren();
      ModulesMetaData modules = ear.getModules();
      if(children != null && modules != null)
      {
         for(DeploymentUnit child : children)
         {
            String moduleName = child.getSimpleName();
            ModuleMetaData module = modules.get(moduleName);
            if(module != null && module.getAlternativeDD() != null)
            {
               VirtualFile altDDFile = unit.getRoot().getChild(module.getAlternativeDD());
               if(altDDFile == null)
                  throw new IllegalStateException("Failed to locate alternative DD '" + module.getAlternativeDD() + "' in " + unit.getRoot().getPathName());
View Full Code Here

         {
            scanEar(file, appMetaData);
         }

         // Create subdeployments for the ear modules
         ModulesMetaData modules = appMetaData.getModules();
         if(modules != null)
         {
            for (ModuleMetaData mod : modules)
            {
               String fileName = mod.getFileName();
View Full Code Here

   {
      List<VirtualFile> archives = root.getChildren();
      if (archives != null)
      {
         String earPath = root.getPathName();
         ModulesMetaData modules = appMetaData.getModules();
         if (modules == null)
         {
            modules = new ModulesMetaData();
            appMetaData.setModules(modules);
         }
         for (VirtualFile vfArchive : archives)
         {
            String filename = earRelativePath(earPath, vfArchive.getPathName());
            // Check if the module already exists, i.e. it is declared in jboss-app.xml
            ModuleMetaData moduleMetaData = appMetaData.getModule(filename);
            int type = typeFromSuffix(filename, vfArchive);
            if (type >= 0 && moduleMetaData == null)
            {
               moduleMetaData = new ModuleMetaData();
               AbstractModule module = null;
               switch(type)
               {
                  case J2eeModuleMetaData.EJB:
                     module = new EjbModuleMetaData();
                     break;
                  case J2eeModuleMetaData.CLIENT:
                     module = new JavaModuleMetaData();
                     break;
                  case J2eeModuleMetaData.CONNECTOR:
                     module = new ConnectorModuleMetaData();
                     break;
                  case J2eeModuleMetaData.SERVICE:
                  case J2eeModuleMetaData.HAR:
                     module = new ServiceModuleMetaData();
                     break;
                  case J2eeModuleMetaData.WEB:
                     module = new WebModuleMetaData();
                     break;
               }
               module.setFileName(filename);
               moduleMetaData.setValue(module);
               modules.add(moduleMetaData);
            }
         }
      }
   }
View Full Code Here

   {
      List<VirtualFile> archives = root.getChildren();
      if (archives != null)
      {
         String earPath = root.getPathName();
         ModulesMetaData modules = j2eeMetaData.getModules();
         if (modules == null)
         {
            modules = new ModulesMetaData();
            j2eeMetaData.setModules(modules);
         }
         for (VirtualFile vfArchive : archives)
         {
            String filename = earRelativePath(earPath, vfArchive.getPathName());
            // Check if the module already exists, i.e. it is declared in jboss-app.xml
            ModuleMetaData moduleMetaData = j2eeMetaData.getModule(filename);
            int type = typeFromSuffix(unit, filename, vfArchive);
            if (type >= 0 && moduleMetaData == null)
            {
               moduleMetaData = new ModuleMetaData();
               AbstractModule module = null;
               switch(type)
               {
                  case J2eeModuleMetaData.EJB:
                     module = new EjbModuleMetaData();
                     break;
                  case J2eeModuleMetaData.CLIENT:
                     module = new JavaModuleMetaData();
                     break;
                  case J2eeModuleMetaData.CONNECTOR:
                     module = new ConnectorModuleMetaData();
                     break;
                  case J2eeModuleMetaData.SERVICE:
                  case J2eeModuleMetaData.HAR:
                     module = new ServiceModuleMetaData();
                     break;
                  case J2eeModuleMetaData.WEB:
                     module = new WebModuleMetaData();
                     break;
               }
               module.setFileName(filename);
               moduleMetaData.setValue(module);
               modules.add(moduleMetaData);
            }
         }
      }
   }
View Full Code Here

        final EarMetaData earMetaData = parent.getAttachment(Attachments.EAR_METADATA);
        if(earMetaData == null) {
            return; // Nothing to see here
        }

        final ModulesMetaData modulesMetaData = earMetaData.getModules();
        if(modulesMetaData != null) for(ModuleMetaData moduleMetaData : modulesMetaData) {
            if(Web.equals(moduleMetaData.getType()) && moduleMetaData.getFileName().equals(deploymentRoot.getRootName())) {
                String contextRoot = WebModuleMetaData.class.cast(moduleMetaData.getValue()).getContextRoot();

                if(contextRoot == null && (warMetaData.getJBossWebMetaData() == null || warMetaData.getJBossWebMetaData().getContextRoot() == null)) {
View Full Code Here

      }
      else if(original5x != null && original5x.getLibraryDirectory() != null)
         setLibraryDirectory(original5x.getLibraryDirectory());

      if(modules == null)
         modules = new ModulesMetaData();
      ModulesMetaData overrideModules = null;
      ModulesMetaData originalModules = null;
      if(override != null)
         overrideModules = override.getModules();
      if(original != null)
         originalModules = original.getModules();
      modules.merge(overrideModules, originalModules);
View Full Code Here

   }

   public void testEmptyMetaData()
   {
      JBossAppMetaData appMetaData = new JBoss50AppMetaData();
      ModulesMetaData modules = new ModulesMetaData();
      appMetaData.setModules(modules);
      ModuleMetaData module = appMetaData.getModule("something");
      assertNull(module);
   }
View Full Code Here

/* 229 */       if (scan)
/*     */       {
/* 231 */         scanEar(file, appMetaData);
/*     */       }
/*     */
/* 235 */       ModulesMetaData modules = appMetaData.getModules();
/* 236 */       if (modules != null) {
/* 237 */         for (ModuleMetaData mod : modules)
/*     */         {
/* 239 */           String fileName = mod.getFileName();
/* 240 */           if ((fileName != null) && ((fileName = fileName.trim()).length() > 0))
View Full Code Here

/*     */   private void scanEar(VirtualFile root, JBossAppMetaData appMetaData)
/*     */     throws IOException
/*     */   {
/* 297 */     List archives = root.getChildren();
/*     */     String earPath;
/*     */     ModulesMetaData modules;
/* 298 */     if (archives != null)
/*     */     {
/* 300 */       earPath = root.getPathName();
/* 301 */       modules = appMetaData.getModules();
/* 302 */       if (modules == null)
/*     */       {
/* 304 */         modules = new ModulesMetaData();
/* 305 */         appMetaData.setModules(modules);
/*     */       }
/* 307 */       for (VirtualFile vfArchive : archives)
/*     */       {
/* 309 */         String filename = earRelativePath(earPath, vfArchive.getPathName());
/*     */
/* 311 */         ModuleMetaData moduleMetaData = appMetaData.getModule(filename);
/* 312 */         int type = typeFromSuffix(filename, vfArchive);
/* 313 */         if ((type >= 0) && (moduleMetaData == null))
/*     */         {
/* 315 */           moduleMetaData = new ModuleMetaData();
/* 316 */           AbstractModule module = null;
/* 317 */           switch (type)
/*     */           {
/*     */           case 0:
/* 320 */             module = new EjbModuleMetaData();
/* 321 */             break;
/*     */           case 2:
/* 323 */             module = new JavaModuleMetaData();
/* 324 */             break;
/*     */           case 3:
/* 326 */             module = new ConnectorModuleMetaData();
/* 327 */             break;
/*     */           case 4:
/*     */           case 5:
/* 330 */             module = new ServiceModuleMetaData();
/* 331 */             break;
/*     */           case 1:
/* 333 */             module = new WebModuleMetaData();
/*     */           }
/*     */
/* 336 */           module.setFileName(filename);
/* 337 */           moduleMetaData.setValue(module);
/* 338 */           modules.add(moduleMetaData);
/*     */         }
/*     */       }
/*     */     }
/*     */   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ear.spec.ModulesMetaData

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.