/** * Sets the application to which I belong. */ public void setApplication(Application a) { application = a; for (List<? extends RootDeploymentDescriptor> extensionsByType : extensions.values()) { for (RootDeploymentDescriptor extension : extensionsByType) { if (extension instanceof BundleDescriptor) { ((BundleDescriptor) extension).setApplication(a); } } } }
/** * Sets the application to which I belong. */ public void setApplication(Application a) { application = a; for (List<? extends RootDeploymentDescriptor> extensionsByType : extensions.values()) { for (RootDeploymentDescriptor extension : extensionsByType) { if (extension instanceof BundleDescriptor) { ((BundleDescriptor) extension).setApplication(a); } } } }
/** * Remove a web bundle descriptor from this application. * * @param bundleDescriptor the web bundle descriptor to remove */ public void removeBundleDescriptor(BundleDescriptor bundleDescriptor) { bundleDescriptor.setApplication(null); getWebBundleDescriptors().remove(bundleDescriptor); }
/** * Remove a web bundle descriptor from this application. * * @param bundleDescriptor the web bundle descriptor to remove */ public void removeBundleDescriptor(BundleDescriptor bundleDescriptor) { bundleDescriptor.setApplication(null); getBundleDescriptors().remove(bundleDescriptor); }
public void removeModule(ModuleDescriptor<BundleDescriptor> descriptor) { if (modules.contains(descriptor)) { if (descriptor.getDescriptor() != null) { descriptor.getDescriptor().setApplication(null); } modules.remove(descriptor); } }
public void addModule(ModuleDescriptor<BundleDescriptor> descriptor) { modules.add(descriptor); if (descriptor.getDescriptor() != null) { descriptor.getDescriptor().setApplication(this); } }
public void removeModule(ModuleDescriptor<BundleDescriptor> descriptor) { if (modules.contains(descriptor)) { if (descriptor.getDescriptor() != null) { descriptor.getDescriptor().setApplication(null); } modules.remove(descriptor); } }
public void addModule(ModuleDescriptor<BundleDescriptor> descriptor) { modules.add(descriptor); if (descriptor.getDescriptor() != null) { descriptor.getDescriptor().setApplication(this); } }
/** * Read all Java EE deployment descriptors and annotations * * @return the initialized descriptor */ private T readDeploymentDescriptors(ReadableArchive descriptorArchive, ReadableArchive contentArchive, Application app) throws IOException, SAXException { // read the standard deployment descriptors T descriptor = readStandardDeploymentDescriptor(descriptorArchive); descriptor.setApplication(app); ModuleDescriptor newModule = createModuleDescriptor(descriptor); newModule.setArchiveUri(contentArchive.getURI().getSchemeSpecificPart()); return readRestDeploymentDescriptors(descriptor, descriptorArchive, contentArchive, app); }
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); }
public Application openWith(Application app, ReadableArchive archive) throws IOException, SAXException { setManifest(archive.getManifest()); // application archivist will override this method if (app.isVirtual()) { T descriptor = readRestDeploymentDescriptors((T)app.getStandaloneBundleDescriptor(), archive, archive, app); if (descriptor != null) { postOpen(descriptor, archive); descriptor.setApplication(app); } } return app; }
public Application openWith(Application app, ReadableArchive archive) throws IOException, SAXParseException { setManifest(archive.getManifest()); // application archivist will override this method if (app.isVirtual()) { T descriptor = readRestDeploymentDescriptors((T)app.getStandaloneBundleDescriptor(), archive, archive, app); if (descriptor != null) { postOpen(descriptor, archive); } if (descriptor instanceof BundleDescriptor) { ((BundleDescriptor)descriptor).setApplication(app); } } return app; }
descriptor.setApplication(app); is.close(); descriptor.getModuleDescriptor().getModuleName()); aModule.setDescriptor(descriptor); descriptor.setApplication(app); aModule.setManifest(newArchivist.getManifest());
((BundleDescriptor)descriptor).setApplication(app); is.close(); descriptor.getModuleDescriptor().getModuleName()); aModule.setDescriptor((BundleDescriptor) descriptor); ((BundleDescriptor) descriptor).setApplication(app); aModule.setManifest(newArchivist.getManifest());
newModule.setArchiveUri(untaggedName); if (newModule.getDescriptor() != null) { newModule.getDescriptor().setApplication(application);
/** * 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; }