Package org.apache.geronimo.xbeans.geronimo.j2ee

Examples of org.apache.geronimo.xbeans.geronimo.j2ee.GerApplicationDocument


        return applicationDocument;
    }

    private URI getParentId(XmlObject plan) throws DeploymentException {
        if (plan instanceof GerApplicationDocument) {
            GerApplicationDocument applicationDoc = (GerApplicationDocument) plan;
            GerApplicationType application = applicationDoc.getApplication();
            if (application.isSetParentId()) {
                try {
                    return new URI(application.getParentId());
                } catch (URISyntaxException e) {
                    throw new DeploymentException("Invalid parentId " + application.getParentId(), e);
View Full Code Here


        return null;
    }

    private URI getConfigId(XmlObject plan) throws DeploymentException {
        if (plan instanceof GerApplicationDocument) {
            GerApplicationDocument applicationDoc = (GerApplicationDocument) plan;
            GerApplicationType application = applicationDoc.getApplication();
            try {
                return new URI(application.getConfigId());
            } catch (URISyntaxException e) {
                throw new DeploymentException("Invalid configId " + application.getConfigId(), e);
            }
View Full Code Here

        }

        GerApplicationType gerApplication = null;
        try {
            // load the geronimo-application.xml from either the supplied plan or from the earFile
            GerApplicationDocument gerApplicationDoc = null;
            XmlObject rawPlan = null;
            try {
                if (planFile != null) {
                    rawPlan = XmlBeansUtil.parse(planFile.toURL());
                    gerApplication = (GerApplicationType) SchemaConversionUtils.fixGeronimoSchema(rawPlan, APPLICATION_QNAME, GerApplicationType.type);
View Full Code Here

            GerModuleType newModule = getEnterpriseApp().addNewModule();
            newModule.addNewEjb().setStringValue(moduleName);
            EjbConfigData ejbConfig = ejbModules.get(moduleName);
        }

        GerApplicationDocument appDocument = GerApplicationDocument.Factory.newInstance();
        appDocument.setApplication(enterpriseApp);
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        XmlOptions options = new XmlOptions();
        options.setSavePrettyPrint();
        options.setSavePrettyPrintIndent(4);
        options.setUseDefaultNamespace();
        appDocument.save(outputStream, options);
        outputStream.close();
        deploymentPlan = new String(outputStream.toByteArray(), "US-ASCII");
        return deploymentPlan;
    }
View Full Code Here

    }

    public String setDeploymentPlan(String deploymentPlan) {
        this.deploymentPlan = deploymentPlan;
        try {
            GerApplicationDocument doc = GerApplicationDocument.Factory.parse(deploymentPlan);           
            this.enterpriseApp = doc.getApplication();
            this.environmentConfig = new EnvironmentConfigData(this.enterpriseApp.getEnvironment());
        } catch(XmlException e) {
            return e.getMessage();
        }
        return null;
View Full Code Here

        }

        GerApplicationType gerApplication = null;
        try {
            // load the geronimo-application.xml from either the supplied plan or from the earFile
            GerApplicationDocument gerApplicationDoc = null;
            try {
                if (planFile != null) {
                    gerApplicationDoc = GerApplicationDocument.Factory.parse(planFile);
                } else {
                    URL path = DeploymentUtil.createJarURL(earFile, "META-INF/geronimo-application.xml");
                    gerApplicationDoc = GerApplicationDocument.Factory.parse(path);
                }
            } catch (IOException e) {
            }

            // if we got one extract the validate it otherwise create a default one
            if (gerApplicationDoc != null) {
                gerApplicationDoc = (GerApplicationDocument) SchemaConversionUtils.convertToGeronimoServiceSchema(gerApplicationDoc);
                gerApplicationDoc = (GerApplicationDocument) SchemaConversionUtils.convertToGeronimoNamingSchema(gerApplicationDoc);
                gerApplicationDoc = (GerApplicationDocument) SchemaConversionUtils.convertToGeronimoSecuritySchema(gerApplicationDoc);
                SchemaConversionUtils.validateDD(gerApplicationDoc);
                gerApplication = gerApplicationDoc.getApplication();
            } else {
                gerApplication = createDefaultPlan(application, earFile);
            }
        } catch (XmlException e) {
            throw new DeploymentException(e);
View Full Code Here

TOP

Related Classes of org.apache.geronimo.xbeans.geronimo.j2ee.GerApplicationDocument

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.