Search in sources :

Example 6 with ConfigurationDeploymentDescriptorFile

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;
}
Also used : ConfigurationDeploymentDescriptorFile(com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile)

Example 7 with ConfigurationDeploymentDescriptorFile

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();
    }
}
Also used : ConfigurationDeploymentDescriptorFile(com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile) OutputStream(java.io.OutputStream)

Example 8 with ConfigurationDeploymentDescriptorFile

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;
}
Also used : ConfigurationDeploymentDescriptorFile(com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile) ArrayList(java.util.ArrayList)

Example 9 with ConfigurationDeploymentDescriptorFile

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;
}
Also used : ConfigurationDeploymentDescriptorFile(com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile) ArrayList(java.util.ArrayList) ConfigurationDeploymentDescriptorFile(com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile) File(java.io.File)

Example 10 with ConfigurationDeploymentDescriptorFile

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;
}
Also used : ConfigurationDeploymentDescriptorFile(com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile) GFAppClientRuntimeDDFile(com.sun.enterprise.deployment.io.runtime.GFAppClientRuntimeDDFile) GFAppClientRuntimeDDFile(com.sun.enterprise.deployment.io.runtime.GFAppClientRuntimeDDFile) AppClientRuntimeDDFile(com.sun.enterprise.deployment.io.runtime.AppClientRuntimeDDFile)

Aggregations

ConfigurationDeploymentDescriptorFile (com.sun.enterprise.deployment.io.ConfigurationDeploymentDescriptorFile)11 File (java.io.File)3 ArrayList (java.util.ArrayList)3 FileInputStream (java.io.FileInputStream)2 InputStream (java.io.InputStream)2 AppClientRuntimeDDFile (com.sun.enterprise.deployment.io.runtime.AppClientRuntimeDDFile)1 ConnectorRuntimeDDFile (com.sun.enterprise.deployment.io.runtime.ConnectorRuntimeDDFile)1 GFAppClientRuntimeDDFile (com.sun.enterprise.deployment.io.runtime.GFAppClientRuntimeDDFile)1 WLSWebServicesDeploymentDescriptorFile (com.sun.enterprise.deployment.io.runtime.WLSWebServicesDeploymentDescriptorFile)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1