use of com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile in project Payara by payara.
the class ExtensionsArchivist method readRuntimeDeploymentDescriptor.
/**
* 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, SAXParseException {
ConfigurationDeploymentDescriptorFile ddFile = getConfigurationDDFile(main, descriptor, archive);
// original descriptor
if (ddFile == null) {
return descriptor;
}
DOLUtils.readRuntimeDeploymentDescriptor(getSortedConfigurationDDFiles(descriptor, archive, main.getModuleType()), archive, descriptor, main, true);
return descriptor;
}
use of com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile in project Payara by payara.
the class ExtensionsArchivist method writeRuntimeDeploymentDescriptors.
/**
* writes the runtime deployment descriptors to an abstract archive
*
* @param in the input archive
* @param out output archive
*/
public void writeRuntimeDeploymentDescriptors(Archivist main, BundleDescriptor descriptor, ReadableArchive in, WritableArchive out) throws IOException {
// when source archive contains runtime deployment descriptor
// files, write those out
// otherwise write all possible runtime deployment descriptor
// files out
List<ConfigurationDeploymentDescriptorFile> confDDFilesToWrite = getSortedConfigurationDDFiles(descriptor, in, main.getModuleType());
if (confDDFilesToWrite.isEmpty()) {
confDDFilesToWrite = getConfigurationDDFiles(descriptor);
}
for (ConfigurationDeploymentDescriptorFile ddFile : confDDFilesToWrite) {
ddFile.setArchiveType(main.getModuleType());
OutputStream os = out.putNextEntry(ddFile.getDeploymentDescriptorPath());
ddFile.write(descriptor, os);
out.closeEntry();
}
}
use of com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile in project Payara by payara.
the class DOLUtils method getConfigurationDeploymentDescriptorFiles.
/**
* Gets all classes for handling the XML configuration
* @param habitat habitat to search for classes
* @param containerType they type of container they must work on
* @return
*/
public static List<ConfigurationDeploymentDescriptorFile> getConfigurationDeploymentDescriptorFiles(ServiceLocator habitat, String containerType) {
List<ConfigurationDeploymentDescriptorFile> confDDFiles = new ArrayList<ConfigurationDeploymentDescriptorFile>();
for (ServiceHandle<?> serviceHandle : habitat.getAllServiceHandles(ConfigurationDeploymentDescriptorFileFor.class)) {
ActiveDescriptor<?> descriptor = serviceHandle.getActiveDescriptor();
String indexedType = descriptor.getMetadata().get(ConfigurationDeploymentDescriptorFileFor.DESCRIPTOR_FOR).get(0);
if (indexedType.equals(containerType)) {
ConfigurationDeploymentDescriptorFile confDD = (ConfigurationDeploymentDescriptorFile) serviceHandle.getService();
confDDFiles.add(confDD);
}
}
return confDDFiles;
}
use of com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile in project Payara by payara.
the class DOLUtils method processConfigurationDDFiles.
/**
* process the list of the configuration files, and return the sorted
* configuration file with precedence from high to low
* this list takes consideration of what runtime files are
* present in the current archive
* @param ddFiles
* @param archive
* @param archiveType
* @return
* @throws java.io.IOException
*/
public static List<ConfigurationDeploymentDescriptorFile> processConfigurationDDFiles(List<ConfigurationDeploymentDescriptorFile> ddFiles, ReadableArchive archive, ArchiveType archiveType) throws IOException {
File runtimeAltDDFile = archive.getArchiveMetaData(DeploymentProperties.RUNTIME_ALT_DD, File.class);
if (runtimeAltDDFile != null && runtimeAltDDFile.exists() && runtimeAltDDFile.isFile()) {
// specified, the config DD files are already processed
return sortConfigurationDDFiles(ddFiles, archiveType, archive);
}
List<ConfigurationDeploymentDescriptorFile> processedConfDDFiles = new ArrayList<ConfigurationDeploymentDescriptorFile>();
for (ConfigurationDeploymentDescriptorFile ddFile : sortConfigurationDDFiles(ddFiles, archiveType, archive)) {
if (archive.exists(ddFile.getDeploymentDescriptorPath())) {
processedConfDDFiles.add(ddFile);
}
}
return processedConfDDFiles;
}
use of com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile in project Payara by payara.
the class AppClientArchivist method getConfigurationDDFiles.
/**
* @return the list of the DeploymentDescriptorFile responsible for
* handling the configuration deployment descriptors
*/
public List<ConfigurationDeploymentDescriptorFile> getConfigurationDDFiles() {
if (confDDFiles == null) {
confDDFiles = new ArrayList<ConfigurationDeploymentDescriptorFile>();
confDDFiles.add(new GFAppClientRuntimeDDFile());
confDDFiles.add(new AppClientRuntimeDDFile());
}
return confDDFiles;
}
Aggregations