if (extensionsArchivists!=null) { for (ExtensionsArchivist extension : extensionsArchivists) { if (extension.supportsModuleType(getModuleType())) { Object o = extension.open(this, descriptorArchive, descriptor); if (o instanceof RootDeploymentDescriptor) { if (o != descriptor) { extension.addExtension(descriptor, (RootDeploymentDescriptor) o); extension.getKey().readRuntimeDeploymentDescriptor(this, descriptorArchive, extension.getValue());
/** * Write extension descriptors * @param in the input archive * @param out the output archive */ public void writeExtensionDeploymentDescriptors(ReadableArchive in, WritableArchive out) throws IOException { // we need to re-initialize extension archivists, but we don't have // applicable sniffers information here, so we will get all extension // archivists with matched type. This is ok as it's just for writing // out deployment descriptors which will not be invoked in normal // code path Collection<ExtensionsArchivist> extArchivists = habitat.getAllServices(ExtensionsArchivist.class); for (ExtensionsArchivist extension : extArchivists) { if (extension.supportsModuleType(getModuleType())) { extension.writeDeploymentDescriptors(this, getDescriptor(), in, out); } } }
/** * Read the runtime deployment descriptors of the extension * * @param archivist the primary archivist for this archive * @param archive the archive * @param descriptor the extension deployment descriptor * @return the extension descriptor object with additional runtime information */ public Object readRuntimeDeploymentDescriptor(Archivist main, ReadableArchive archive, RootDeploymentDescriptor descriptor) throws IOException, SAXException { ConfigurationDeploymentDescriptorFile ddFile = getConfigurationDDFile(main, descriptor, archive); // if this extension archivist has no runtime DD, just return the // original descriptor if (ddFile == null) { return descriptor; } DOLUtils.readRuntimeDeploymentDescriptor(getSortedConfigurationDDFiles(descriptor, archive, main.getModuleType()), archive, descriptor, main,true); return descriptor; }
if (extensionsArchivists!=null) { for (ExtensionsArchivist extension : extensionsArchivists) { Object o = extension.open(this, descriptorArchive, descriptor); if (o instanceof RootDeploymentDescriptor) { if (o != descriptor) { extension.addExtension(descriptor, (RootDeploymentDescriptor) o); extension.getKey().readRuntimeDeploymentDescriptor(this, descriptorArchive, extension.getValue());
try { if (extension.getValue()==null) { RootDeploymentDescriptor o = extension.getKey().getDefaultDescriptor(); processAnnotations(o, extension.getKey().getScanner(), archive); if (o!=null && !o.isEmpty()) { extension.getKey().addExtension(descriptor, o); extensions.put(extension.getKey(), (RootDeploymentDescriptor) o); processAnnotations(extension.getValue(), extension.getKey().getScanner(), archive);
if (extension.supportsModuleType(aModule.getModuleType())) { Object rdd = extension.open(newArchivist, embeddedArchive, descriptor); if (rdd instanceof RootDeploymentDescriptor) { extensions.put(extension, (RootDeploymentDescriptor) rdd); extension.getKey().readRuntimeDeploymentDescriptor(newArchivist, embeddedArchive, extension.getValue());
@Override public Object open(Archivist main, ReadableArchive archive, RootDeploymentDescriptor descriptor) throws IOException, SAXException { BundleDescriptor bundleDescriptor = BundleDescriptor.class.cast(super.open(main, archive, descriptor)); if (bundleDescriptor != null) { return bundleDescriptor.getWebServices(); } else if (descriptor instanceof BundleDescriptor) { return BundleDescriptor.class.cast(descriptor).getWebServices(); } else throw new IllegalArgumentException("" + descriptor + " is not instance of BundleDescriptor"); }
public Object readRuntimeDeploymentDescriptor(Archivist main, ReadableArchive archive, RootDeploymentDescriptor descriptor) throws IOException, SAXParseException { DeploymentDescriptorFile confDD = getConfigurationDDFile(descriptor); is = archive.getEntry(confDDPath); if (is == null) { confDD = getSunConfigurationDDFile(descriptor); if (confDD != null) { confDDPath = confDD.getDeploymentDescriptorPath(); getGFCounterPartConfigurationDDFile(descriptor); if (gfConfDD != null) { is2 = archive.getEntry( getSunCounterPartConfigurationDDFile(descriptor); if (sunConfDD != null) { is3 = archive.getEntry(
if (extensionsArchivists != null) { for (ExtensionsArchivist extension : extensionsArchivists) { Object rdd = extension.open(newArchivist, embeddedArchive, descriptor); if (rdd instanceof RootDeploymentDescriptor) { extensions.put(extension, (RootDeploymentDescriptor) rdd); extension.getKey().readRuntimeDeploymentDescriptor(newArchivist, embeddedArchive, extension.getValue());
/** * writes the deployment descriptors (standard and runtime) * to a JarFile using the right deployment descriptor path * * @param in the input archive * @param out the abstract archive file to write to */ @Override public void writeDeploymentDescriptors(Archivist main, BundleDescriptor descriptor, ReadableArchive in, WritableArchive out) throws IOException { if (descriptor.hasWebServices()) { super.writeDeploymentDescriptors(main, descriptor, in, out); } } }
public Object open(Archivist main, ReadableArchive archive, RootDeploymentDescriptor descriptor) throws IOException, SAXParseException { DeploymentDescriptorFile confDD = getStandardDDFile(descriptor); if (archive.getURI() != null) { confDD.setErrorReportingString(archive.getURI().getSchemeSpecificPart()); } InputStream is = null; try { is = archive.getEntry(confDD.getDeploymentDescriptorPath()); if (is == null) { if (logger.isLoggable(Level.FINE)) { logger.log(Level.FINE, "Deployment descriptor: " + confDD.getDeploymentDescriptorPath(), " does not exist in archive: " + archive.getURI().getSchemeSpecificPart()); } } else { confDD.setXMLValidation(main.getXMLValidation()); confDD.setXMLValidationLevel(main.getXMLValidationLevel()); return confDD.read(descriptor, is); } } finally { if (is != null) { is.close(); } } return null; }
public List<ExtensionsArchivist> getExtensionsArchists(XModuleType moduleType) { List<ExtensionsArchivist> archivists = new ArrayList<ExtensionsArchivist>(); for (ExtensionsArchivist ea : extensionsArchivists) { if (ea.supportsModuleType(moduleType)) { archivists.add(ea); } } return archivists; }
RootDeploymentDescriptor o = extension.getKey().getDefaultDescriptor(); if( o != null ) { o.setModuleDescriptor(descriptor.getModuleDescriptor()); processAnnotations(o, extension.getKey().getScanner(), archive); if (o!=null && !o.isEmpty()) { extension.getKey().addExtension(descriptor, o); extensions.put(extension.getKey(), (RootDeploymentDescriptor) o); extBundle = (BundleDescriptor)extension.getValue(); if (isProcessAnnotation(extBundle)) { processAnnotations(extBundle, extension.getKey().getScanner(), archive);
@Override public Object open(Archivist main, ReadableArchive archive, RootDeploymentDescriptor descriptor) throws IOException, SAXParseException { BundleDescriptor bundleDescriptor = BundleDescriptor.class.cast(super.open(main, archive, descriptor)); if (bundleDescriptor != null) { return bundleDescriptor.getWebServices(); } else { return BundleDescriptor.class.cast(descriptor).getWebServices(); } }
/** * writes the deployment descriptors (standard and runtime) * to a JarFile using the right deployment descriptor path * * @param in the input archive * @param out the abstract archive file to write to */ @Override public void writeDeploymentDescriptors(Archivist main, BundleDescriptor descriptor, ReadableArchive in, WritableArchive out) throws IOException { Collection<EjbBundleDescriptorImpl> ejbExtensions = descriptor.getExtensionsDescriptors(EjbBundleDescriptorImpl.class); for (EjbBundleDescriptorImpl ejbBundle : ejbExtensions) { super.writeDeploymentDescriptors(main, ejbBundle, in, out); } } }
/** * writes the standard deployment descriptors to an abstract archive * * @param out archive to write to */ public void writeStandardDeploymentDescriptors(Archivist main, BundleDescriptor descriptor, WritableArchive out) throws IOException { getStandardDDFile(descriptor).setArchiveType(main.getModuleType()); OutputStream os = out.putNextEntry(standardDD.getDeploymentDescriptorPath()); standardDD.write(descriptor, os); out.closeEntry(); }
@SuppressWarnings("unchecked") public List<ExtensionsArchivist> getExtensionsArchivists(Collection<Sniffer> sniffers, ArchiveType moduleType) { Set<String> containerTypes = new HashSet<String>(); for (Sniffer sniffer : sniffers) { containerTypes.add(sniffer.getModuleType()); } List<ExtensionsArchivist> archivists = new ArrayList<ExtensionsArchivist>(); for (String containerType : containerTypes) { List<ActiveDescriptor<?>> descriptors = habitat.getDescriptors( new ArchivistFilter(containerType, EXTENSION_ARCHIVE_TYPE, ExtensionsArchivist.class)); for (ActiveDescriptor<?> item : descriptors) { ActiveDescriptor<ExtensionsArchivist> descriptor = (ActiveDescriptor<ExtensionsArchivist>) item; ServiceHandle<ExtensionsArchivist> handle = habitat.getServiceHandle(descriptor); ExtensionsArchivist ea = handle.getService(); if (ea.supportsModuleType(moduleType)) { archivists.add(ea); } } } return archivists; }
if (extension.supportsModuleType(getModuleType())) { Object o = extension.open(this, archive, descriptor); if (o instanceof RootDeploymentDescriptor) { if (o != descriptor) { extension.addExtension(descriptor, (RootDeploymentDescriptor) o); extension.getKey().readRuntimeDeploymentDescriptor(this, archive, extension.getValue());
protected PersistenceUnitsDescriptor readPersistenceDeploymentDescriptor(Archivist main, ReadableArchive subArchive, String puRoot, RootDeploymentDescriptor descriptor) throws IOException, SAXParseException { final String subArchiveURI = subArchive.getURI().getSchemeSpecificPart(); if (logger.isLoggable(Level.FINE)) { logger.logp(Level.FINE, "Archivist", "readPersistenceDeploymentDescriptor", "PURoot = [{0}] subArchive = {1}", new Object[]{puRoot, subArchiveURI}); } if (descriptor.getExtensionsDescriptors(PersistenceUnitsDescriptor.class, puRoot) != null) { if (logger.isLoggable(Level.FINE)) { logger.logp(Level.FINE, "Archivist", "readPersistenceDeploymentDescriptor", "PU has been already read for = {0}", subArchiveURI); } return null; } PersistenceUnitsDescriptor persistenceUnitsDescriptor = PersistenceUnitsDescriptor.class.cast(super.open(main, subArchive, descriptor)); if (persistenceUnitsDescriptor!=null) { persistenceUnitsDescriptor.setParent(descriptor); persistenceUnitsDescriptor.setPuRoot(puRoot); descriptor.addExtensionDescriptor(PersistenceUnitsDescriptor.class,persistenceUnitsDescriptor, puRoot); } return persistenceUnitsDescriptor; }
getStandardDDFile(descriptor).setArchiveType(main.getModuleType()); if (archive.getURI() != null) { standardDD.setErrorReportingString(archive.getURI().getSchemeSpecificPart());