Package com.sun.enterprise.deployment.io

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


     * writes de configuration deployment descriptor to a new XML file
     *
     * @param os stream to write the configuration deployment descriptors
     */
    public void writeRuntimeDeploymentDescriptors(OutputStream os) throws IOException {
        DeploymentDescriptorFile confDD = getConfigurationDDFile();
        if (confDD != null) {
            confDD.write(getDescriptor(), os);
        }
    }
View Full Code Here


     * @param out the output archive
     */
    protected void writeWebServicesDescriptors(BundleDescriptor desc, WritableArchive out)
            throws IOException {
        if (desc.hasWebServices()) {
            DeploymentDescriptorFile webServicesDD = getWebServicesDDFile(desc);
            OutputStream os = out.putNextEntry(webServicesDD.getDeploymentDescriptorPath());
            webServicesDD.write(desc, os);
            out.closeEntry();
        }
    }
View Full Code Here

     * @param out the output archive
     */
    private void writeWLWebServicesDescriptors(BundleDescriptor desc, WritableArchive out)
            throws IOException {
        if (desc.hasWebServices()) {
            DeploymentDescriptorFile webServicesDD = new WLWebServicesDeploymentDescriptorFile(desc.getWebServices());
            OutputStream os = out.putNextEntry(webServicesDD.getDeploymentDescriptorPath());
            webServicesDD.write(desc.getWebServices(), os);
            out.closeEntry();
        }
    }
View Full Code Here

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

        // only bundle descriptor can have web services
        if (desc instanceof BundleDescriptor) {
            BundleDescriptor desc2 = (BundleDescriptor) desc;
            if (desc2.hasWebServices()) {
                DeploymentDescriptorFile webServicesDD =
                        getWebServicesDDFile((BundleDescriptor) desc2);
                String anEntry = webServicesDD.getDeploymentDescriptorPath();
                copyAnEntry(in, out, anEntry);
            }
        }
    }
View Full Code Here

    }

    @Override
    public Object readRuntimeDeploymentDescriptor(Archivist main, ReadableArchive archive, RootDeploymentDescriptor descriptor)
            throws IOException, SAXParseException {
        DeploymentDescriptorFile configDD = getConfigurationDDFile(descriptor);
        String configDDPath = configDD.getDeploymentDescriptorPath();
        if (archive.exists(configDDPath)) {
            DOLUtils.getDefaultLogger().warning(
                    localStrings.getLocalString("enterprise.deployment.archivist.DDNotSupported",
                    "Ignore {0} as it is not supported in this release.", new Object[]{configDDPath}));
        }
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

        String dd = "unavailable";
        ByteArrayOutputStream out = null;
        try
        {
            final Archivist moduleArchivist = archivistFactory.getArchivist(bundleDesc.getModuleDescriptor().getModuleType());
            final DeploymentDescriptorFile ddFile =  moduleArchivist.getStandardDDFile();
           
            out = new ByteArrayOutputStream();
            ddFile.write(bundleDesc, out);
            final String charsetName = "UTF-8";
            dd = out.toString(charsetName);
        }
        catch( final Exception e )
        {
View Full Code Here

        String dd = "unavailable";
        ByteArrayOutputStream out = null;
        try
        {
            final Archivist moduleArchivist = archivistFactory.getArchivist(bundleDesc.getModuleDescriptor().getModuleType());
            final DeploymentDescriptorFile ddFile =  moduleArchivist.getStandardDDFile();
           
            out = new ByteArrayOutputStream();
            ddFile.write(bundleDesc, out);
            final String charsetName = "UTF-8";
            dd = out.toString(charsetName);
        }
        catch( final Exception e )
        {
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.