/** * receives notification of the value for a particular tag * * @param element the xml element * @param value it's associated value */ public void setElementValue(XMLElement element, String value) { ModuleDescriptor descriptor = (ModuleDescriptor) getDescriptor(); if (element.getQName().equals(ApplicationTagNames.WEB_URI)) { descriptor.setModuleType(XModuleType.WAR); descriptor.setArchiveUri(value); } else if (element.getQName().equals(ApplicationTagNames.EJB)) { descriptor.setModuleType(XModuleType.EJB); descriptor.setArchiveUri(value); } else if (element.getQName().equals(ApplicationTagNames.CONNECTOR)) { descriptor.setModuleType(XModuleType.RAR); descriptor.setArchiveUri(value); } else if (element.getQName().equals(ApplicationTagNames.APPLICATION_CLIENT)) { descriptor.setModuleType(XModuleType.CAR); descriptor.setArchiveUri(value); } else if (element.getQName().equals(ApplicationTagNames.WEB)) { descriptor.setModuleType(XModuleType.WAR); } else super.setElementValue(element, value); }
private T readDeploymentDescriptors(ReadableArchive descriptorArchive, ReadableArchive contentArchive, Application app) throws IOException, SAXParseException { // read the standard deployment descriptors T descriptor = readStandardDeploymentDescriptor(descriptorArchive); if (descriptor instanceof BundleDescriptor) { ((BundleDescriptor)descriptor).setApplication(app); } ModuleDescriptor newModule = createModuleDescriptor(descriptor); newModule.setArchiveUri(contentArchive.getURI().getSchemeSpecificPart()); return readRestDeploymentDescriptors(descriptor, descriptorArchive, contentArchive, app); }
EjbBundleDescriptor bundleDesc = (EjbBundleDescriptor) eddf.read(is); ModuleDescriptor moduleDesc = bundleDesc.getModuleDescriptor(); moduleDesc.setArchiveUri(fileName); moduleName = moduleDesc.getModuleName(); } else {
name.endsWith(".war")))) { ModuleDescriptor<BundleDescriptor> md = new ModuleDescriptor<BundleDescriptor>(); md.setArchiveUri(uri); md.setModuleType(XModuleType.WAR); name.endsWith(".rar")))) { ModuleDescriptor<BundleDescriptor> md = new ModuleDescriptor<BundleDescriptor>(); md.setArchiveUri(uri); md.setModuleType(XModuleType.RAR); app.addModule(md); md.setArchiveUri(uri); md.setModuleType(XModuleType.CAR); md.setManifest(subArchive.getManifest()); md.setArchiveUri(uri); md.setModuleType(XModuleType.EJB); app.addModule(md); md.setArchiveUri(uri); md.setModuleType(XModuleType.EJB); app.addModule(md);
/** * This method creates an Application object from reading the * standard deployment descriptor. * @param archive the archive for the application */ public Application createApplicationFromStandardDD( ReadableArchive archive) throws IOException, SAXParseException { Archivist archivist = archivistFactory.getArchivist(archive, null); String xmlValidationLevel = dasConfig.getDeployXmlValidation(); archivist.setXMLValidationLevel(xmlValidationLevel); if (xmlValidationLevel.equals("none")) { archivist.setXMLValidation(false); } RootDeploymentDescriptor desc = archivist.readStandardDeploymentDescriptor(archive); Application application = null; if (desc instanceof Application) { application = (Application)desc; } else if (desc instanceof BundleDescriptor) { BundleDescriptor aBundle = (BundleDescriptor)desc; ModuleDescriptor newModule = archivist.createModuleDescriptor(aBundle); newModule.setArchiveUri(archive.getURI().getSchemeSpecificPart()); String moduleName = newModule.getModuleName(); application = Application.createApplication(habitat, moduleName, newModule); } return application; }
newModule.setArchiveUri(in.getURI().getSchemeSpecificPart()); application = Application.createApplication(habitat,appName,newModule);
/** * Creates a new application to hold a standalone module * * @param name the application name * @param newModule the standalone module descriptor * @return the application */ public static Application createApplication(Habitat habitat, String name, ModuleDescriptor<BundleDescriptor> newModule) { // create a new empty application Application application = new Application(habitat); application.setVirtual(true); if (name == null && newModule.getDescriptor() != null) { name = newModule.getDescriptor().getDisplayName(); } String untaggedName = VersioningUtils.getUntaggedName(name); if (name != null) { application.setDisplayName(untaggedName); application.setName(untaggedName); application.setAppName(untaggedName); } // add the module to it newModule.setStandalone(true); newModule.setArchiveUri(untaggedName); if (newModule.getDescriptor() != null) { newModule.getDescriptor().setApplication(application); } application.addModule(newModule); return application; }
descriptor.getModuleDescriptor().setArchiveUri( aModule.getArchiveUri()); aModule.setModuleName(