public String getUri() { if (module != null) return module.getUri(); if (moduleFile != null) return moduleFile.getURI(); return null; }
protected void invalidDepedencyWarning(String entry, Archive anArchive, ModuleFile m) { String[] params = new String[3]; params[0] = m.getURI(); params[1] = entry; params[2] = anArchive.getURI(); String msg = NLS.bind(EARValidationMessageResourceHandler.INVALID_MANIFEST_CLASSPATH_DEPENDENCY_WARN_, params); addLocalizedWarning(msg, getManifestFile(anArchive), MANIFEST_GROUP_NAME); }
/** * Checks if the modules are a spec level too high for the EAR file. */ private void validateSpecLevel() { int earVersion = getVersionID(earFile); List modules = earFile.getModuleFiles(); if( !modules.isEmpty() ) { Iterator iterator = modules.iterator(); ModuleFile moduleFile = null; while (iterator.hasNext()) { moduleFile = (ModuleFile)iterator.next(); if (moduleFile != null && getVersionID(moduleFile) > earVersion) { String[] params = new String[] {moduleFile.getURI(), earFile.getName()}; String tmp = NLS.bind(EARValidationMessageResourceHandler.MESSAGE_INCOMPATIBLE_SPEC_WARNING_, params); addLocalizedWarning(tmp, appDD); } } } }
protected Object primAddCopyRef(ModuleFile aModuleFile) throws DuplicateObjectException { //force this list to get initialized before the add EList refs = getModuleRefs(); if (aModuleFile.isEARFile()) //If it's an ear then just treat it like any other archive return super.addCopy(aModuleFile); checkAddValid(aModuleFile); ModuleFile copy = getCommonArchiveFactory().copy(aModuleFile); Module newModule = createModuleForCopying(aModuleFile); getFiles().add(copy); copy.initializeClassLoader(); if (!copy.getURI().equals(newModule.getUri())) copy.setURI(newModule.getUri()); getDeploymentDescriptor().getModules().add(newModule); ModuleRef aRef = createModuleRef(newModule, copy); refs.add(aRef); return aRef; }
protected Module createModuleForCopying(ModuleFile aModuleFile) { Module aModule = null; if (aModuleFile.isWARFile()) { aModule = getApplicationFactory().createWebModule(); } else if (aModuleFile.isEJBJarFile()) { aModule = getApplicationFactory().createEjbModule(); } else if (aModuleFile.isApplicationClientFile()) { aModule = getApplicationFactory().createJavaClientModule(); } else if (aModuleFile.isRARFile()) { aModule = getApplicationFactory().createConnectorModule(); } aModule.setUri(aModuleFile.getURI()); return aModule; }