Package com.sun.enterprise.deployment.io

Examples of com.sun.enterprise.deployment.io.DeploymentDescriptorFile


    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();
             }
View Full Code Here


     }

     public Object readRuntimeDeploymentDescriptor(Archivist main, ReadableArchive archive, RootDeploymentDescriptor descriptor)
            throws IOException, SAXParseException {

        DeploymentDescriptorFile confDD = getConfigurationDDFile(descriptor);

        // if this extension archivist has no runtime DD, just return the
        // original descriptor
        if (confDD == null) {
            return descriptor;
        }

        if (archive.getURI() != null) {
            confDD.setErrorReportingString(archive.getURI().getSchemeSpecificPart());
        }
        InputStream is = null;
        InputStream is2 = null;
        InputStream is3 = null;
        try {
            String confDDPath = confDD.getDeploymentDescriptorPath();
            is = archive.getEntry(confDDPath);
            if (is == null) {
                confDD = getSunConfigurationDDFile(descriptor);
                if (confDD != null) {
                    confDDPath = confDD.getDeploymentDescriptorPath();
                    is = archive.getEntry(confDDPath);
                }
            }

            if (is != null) {
                DeploymentDescriptorFile gfConfDD =
                    getGFCounterPartConfigurationDDFile(descriptor);
                if (gfConfDD != null) {
                   is2 = archive.getEntry(
                       gfConfDD.getDeploymentDescriptorPath());
                   // when Glassfish counterpart configuration file is present
                   // we should ignore this extension configuration file
                   if (is2 != null) {
                       logger.log(Level.WARNING,
                           "gf.counterpart.configdd.exists",
                           new Object[] {
                               confDDPath,     
                               archive.getURI().getSchemeSpecificPart(),
                               gfConfDD.getDeploymentDescriptorPath()});
                       return null;
                   }
                }

                DeploymentDescriptorFile sunConfDD =
                    getSunCounterPartConfigurationDDFile(descriptor);
                if (sunConfDD != null) {
                   is3 = archive.getEntry(
                       sunConfDD.getDeploymentDescriptorPath());
                   // when Sun counterpart configuration file is present
                   // we should ignore this extension configuration file
                   if (is3 != null) {
                       logger.log(Level.WARNING,
                           "sun.counterpart.configdd.exists",
                           new Object[] {
                               confDDPath,
                               archive.getURI().getSchemeSpecificPart(),
                               sunConfDD.getDeploymentDescriptorPath()});
                       return null;
                   }
                }

                confDD.setXMLValidation(main.getRuntimeXMLValidation());
View Full Code Here

                if (aModule.getAlternateDescriptor()!=null) {
                    // the application is using alternate deployment descriptors

                    // write or copy standard deployment descriptor
                    String ddPath = aModule.getAlternateDescriptor();
                    DeploymentDescriptorFile ddFile =
                        moduleArchivist.getStandardDDFile();           
                    
                    BundleDescriptor bundle =
                            (BundleDescriptor)aModule.getDescriptor();
                    if (!bundle.isFullFlag()) {
                        if (ddFile != null) {
                            OutputStream os = out.putNextEntry(ddPath);
                            ddFile.write(bundle, os);
                            out.closeEntry();
                        }
                    } else {
                        if (aModule.getModuleType().equals(XModuleType.WAR)) {
                            WebBundleDescriptor webBundle =
                                (WebBundleDescriptor) aModule.getDescriptor();
                            if (webBundle.hasWebServices()) {
                                if (ddFile != null) {
                                    OutputStream os = out.putNextEntry(ddPath);
                                    ddFile.write(webBundle, os);
                                    out.closeEntry();
                                }
                            } else {
                                moduleArchivist.copyAnEntry(in, out, ddPath);
                            }
                        } else {
                            moduleArchivist.copyAnEntry(in, out, ddPath);
                        }
                    }

                    String runtimeDDPath = "glasfish-" + ddPath;
                    DeploymentDescriptorFile confDDFile = moduleArchivist.getConfigurationDDFile();
                    if (confDDFile!=null) {
                        OutputStream os = out.putNextEntry(runtimeDDPath);
                        confDDFile.write(aModule.getDescriptor(), os);
                        out.closeEntry();
                    }
                } else {
                    WritableArchive moduleArchive = out.createSubArchive(aModule.getArchiveUri());
                    ReadableArchive moduleArchive2 = in.getSubArchive(aModule.getArchiveUri());
View Full Code Here

            embeddedArchive.setParentArchive(appArchive);
            if (aModule.getAlternateDescriptor()!=null) {
                // the module use alternate deployement descriptor, ignore the
                // DDs in the archive.
                InputStream is = appArchive.getEntry(aModule.getAlternateDescriptor());
                DeploymentDescriptorFile ddFile = newArchivist.getStandardDDFile();
                ddFile.setXMLValidation(newArchivist.getXMLValidation());
                ddFile.setXMLValidationLevel(newArchivist.getXMLValidationLevel());
                if (appArchive.getURI()!=null) {
                    ddFile.setErrorReportingString(appArchive.getURI().getSchemeSpecificPart());
                }

                descriptor = (BundleDescriptor) ddFile.read(is);
                ((BundleDescriptor)descriptor).setApplication(app);
                is.close();

                // TODO : JD need to be revisited for EAR files with Alternative descriptors, what does
                // it mean for sub components.
                Map<ExtensionsArchivist, RootDeploymentDescriptor> extensions =
                    new HashMap<ExtensionsArchivist, RootDeploymentDescriptor>();
               
                if (extensionsArchivists!=null) {
                    for (ExtensionsArchivist extension : extensionsArchivists) {
                        if (extension.supportsModuleType(aModule.getModuleType())) {
                            Object rdd = extension.open(newArchivist, embeddedArchive, descriptor);
                            if (rdd instanceof RootDeploymentDescriptor) {
                                extensions.put(extension, (RootDeploymentDescriptor) rdd);
                            }
                        }
                    }
                }
                newArchivist.postStandardDDsRead(descriptor, embeddedArchive, extensions);
                newArchivist.readAnnotations(embeddedArchive, descriptor, extensions);
                newArchivist.postAnnotationProcess(descriptor, embeddedArchive);
                newArchivist.postOpen(descriptor, embeddedArchive);
                // now reads the runtime deployment descriptor...
                if (isHandlingRuntimeInfo()) {
                    is = appArchive.getEntry("sun-" + aModule.getAlternateDescriptor());
                    if (is!=null) {
                        DeploymentDescriptorFile confDD =
                            newArchivist.getConfigurationDDFile();
                        confDD.setXMLValidation(
                            newArchivist.getRuntimeXMLValidation());
                        confDD.setXMLValidationLevel(
                            newArchivist.getRuntimeXMLValidationLevel());
                        if (appArchive.getURI()!=null) {
                            confDD.setErrorReportingString(
                                appArchive.getURI().getSchemeSpecificPart());
                        }

                        confDD.read(descriptor, is);
                        is.close();
                        newArchivist.postRuntimeDDsRead((RootDeploymentDescriptor)descriptor, embeddedArchive);
                    } else {
                        if (embeddedArchive!=null) {
                            newArchivist.readRuntimeDeploymentDescriptor(embeddedArchive,descriptor);
View Full Code Here

               
                if (md.getAlternateDescriptor()!=null) {
                    // we are using alternate deployment descriptors
                    is = archive.getEntry("sun-" + md.getAlternateDescriptor());
                    if (is!=null) {
                        DeploymentDescriptorFile confDD =
                            archivist.getConfigurationDDFile();
                        confDD.setXMLValidation(
                            archivist.getRuntimeXMLValidation());
                        confDD.setXMLValidationLevel(
                            archivist.getRuntimeXMLValidationLevel());
                        if (archive.getURI()!=null) {
                            confDD.setErrorReportingString(
                                archive.getURI().getSchemeSpecificPart());
                        }
                        confDD.read(md.getDescriptor(), is);
                        is.close();
                    }                   
                }
                // if is variable is null, it means that we are either
                // not using alternate deployment descriptors or we could
View Full Code Here

    /**
     * @return the location of the runtime deployment descriptor file
     *         for a particular type of J2EE Archive
     */
    public String getRuntimeDeploymentDescriptorPath(ReadableArchive archive) throws IOException {
        DeploymentDescriptorFile ddFile = getConfigurationDDFile(archive);
        if (ddFile != null) {
            return ddFile.getDeploymentDescriptorPath();
        } else {
            return null;
        }
    }
View Full Code Here

    /**
     * @return the location of the runtime deployment descriptor file
     *         for a particular type of J2EE Archive
     */
    public String getRuntimeDeploymentDescriptorPath(ReadableArchive archive) throws IOException {
        DeploymentDescriptorFile ddFile = getConfigurationDDFile(archive);
        if (ddFile != null) {
            return ddFile.getDeploymentDescriptorPath();
        } else {
            return null;
        }
    }
View Full Code Here

            if (aModule.getAlternateDescriptor()!=null) {
                // the module use alternate deployement descriptor, ignore the
                // DDs in the archive.
                InputStream is = appArchive.getEntry(aModule.getAlternateDescriptor());
                DeploymentDescriptorFile ddFile = newArchivist.getStandardDDFile();
                ddFile.setXMLValidation(newArchivist.getXMLValidation());
                ddFile.setXMLValidationLevel(newArchivist.getXMLValidationLevel());
                if (appArchive.getURI()!=null) {
                    ddFile.setErrorReportingString(appArchive.getURI().getSchemeSpecificPart());
                }

                descriptor = (BundleDescriptor) ddFile.read(is);
                descriptor.setApplication(app);
                is.close();

                // TODO : JD need to be revisited for EAR files with Alternative descriptors, what does
                // it mean for sub components.
View Full Code Here

    /**
     * @return the location of the runtime deployment descriptor file
     *         for a particular type of J2EE Archive
     */
    public String getRuntimeDeploymentDescriptorPath(ReadableArchive archive) throws IOException {
        DeploymentDescriptorFile ddFile = getConfigurationDDFile(archive);
        if (ddFile != null) {
            return ddFile.getDeploymentDescriptorPath();
        } else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.io.DeploymentDescriptorFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.