Package org.jboss.metadata.ear.spec

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


      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());
              
               String attachmentName;
               if(module.getType() == ModuleMetaData.ModuleType.Ejb)
                  attachmentName = EjbJarMetaData.class.getName();
               else if(module.getType() == ModuleMetaData.ModuleType.Web)
                  attachmentName = WebMetaData.class.getName();
               else if(module.getType() == ModuleMetaData.ModuleType.Client)
                  attachmentName = ApplicationClientMetaData.class.getName();
               else if(module.getType() == ModuleMetaData.ModuleType.Connector)
                  attachmentName = "org.jboss.resource.metadata.ConnectorMetaData";
               else
                  throw new IllegalStateException("Expected module types in an EAR are ejb, web, java and connector but got " + module.getType() + " for " + child.getName() + " in " + unit.getName());
              
               child.addAttachment(attachmentName + ".altDD", altDDFile);
               if(log.isTraceEnabled())
                  log.trace("attached alt-dd " + altDDFile + " for module " + child.getSimpleName());
            }
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

        String contextRoot = null;

        // prefer context root defined in application.xml over one defined in jboss-web.xml
        if (jbossAppMD != null) {
            final ModuleMetaData moduleMD = jbossAppMD.getModules().get(dep.getSimpleName());
            if (moduleMD != null) {
                final WebModuleMetaData webModuleMD = (WebModuleMetaData) moduleMD.getValue();
                contextRoot = webModuleMD.getContextRoot();
            }
        }

        if (contextRoot == null) {
View Full Code Here

/*     */
/* 290 */     JBossAppMetaData earMetaData = (JBossAppMetaData)AttachmentLocator.search(unit, JBossAppMetaData.class);
/* 291 */     if (earMetaData != null)
/*     */     {
/* 293 */       String path = unit.getRelativePath();
/* 294 */       ModuleMetaData webModule = earMetaData.getModule(path);
/* 295 */       if (webModule != null)
/*     */       {
/* 298 */         String contextRoot = metaData.getContextRoot();
/* 299 */         if (contextRoot == null)
/*     */         {
/* 301 */           WebModuleMetaData wmodule = (WebModuleMetaData)webModule.getValue();
/* 302 */           contextRoot = wmodule.getContextRoot();
/* 303 */           metaData.setContextRoot(contextRoot);
/*     */         }
/*     */
/* 307 */         metaData.setAlternativeDD(webModule.getAlternativeDD());
/*     */       }
/*     */
/* 311 */       if ((metaData.getSecurityDomain() == null) && (earMetaData.getSecurityDomain() != null)) {
/* 312 */         metaData.setSecurityDomain(earMetaData.getSecurityDomain());
/*     */       }
View Full Code Here

/*     */       }
/* 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

/*     */       }
/* 186 */       for (VirtualFile vfArchive : archives)
/*     */       {
/* 188 */         String filename = earRelativePath(earPath, vfArchive.getPathName());
/*     */
/* 190 */         ModuleMetaData moduleMetaData = j2eeMetaData.getModule(filename);
/* 191 */         int type = typeFromSuffix(unit, filename, vfArchive);
/* 192 */         if ((type >= 0) && (moduleMetaData == null))
/*     */         {
/* 194 */           moduleMetaData = new ModuleMetaData();
/* 195 */           AbstractModule module = null;
/* 196 */           switch (type)
/*     */           {
/*     */           case 0:
/* 199 */             module = new EjbModuleMetaData();
/* 200 */             break;
/*     */           case 2:
/* 202 */             module = new JavaModuleMetaData();
/* 203 */             break;
/*     */           case 3:
/* 205 */             module = new ConnectorModuleMetaData();
/* 206 */             break;
/*     */           case 4:
/*     */           case 5:
/* 209 */             module = new ServiceModuleMetaData();
/* 210 */             break;
/*     */           case 1:
/* 212 */             module = new WebModuleMetaData();
/*     */           }
/*     */
/* 215 */           module.setFileName(filename);
/* 216 */           moduleMetaData.setValue(module);
/* 217 */           modules.add(moduleMetaData);
/*     */         }
/*     */       }
/*     */     }
/*     */   }
View Full Code Here

TOP

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

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.