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

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


            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

            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;
            XmlObject rawPlan = null;
            try {
                if (planFile != null) {
                    rawPlan = XmlBeansUtil.parse(planFile.toURL());
                    gerApplication = (GerApplicationType) SchemaConversionUtils.fixGeronimoSchema(rawPlan, "application", GerApplicationType.type);
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) {
                SchemaConversionUtils.validateDD(gerApplicationDoc);
                gerApplication = gerApplicationDoc.getApplication();
            } else {
                gerApplication = createDefaultPlan(application, earFile);
            }
        } catch (XmlException e) {
            throw new DeploymentException(e);
View Full Code Here

            if (module.toString().endsWith("/")) {
                moduleBase = module;
            } else {
                moduleBase = new URL("jar:" + module.toString() + "!/");
            }
            GerApplicationDocument gerAppDoc = (GerApplicationDocument) XmlBeansUtil.getXmlObject(new URL(moduleBase, "META-INF/geronimo-application.xml"), GerApplicationDocument.type);
            if (gerAppDoc != null) {
                return gerAppDoc;
            }

            // try to create a default plan (will return null if this is not an ear file)
            GerApplicationDocument defaultPlan = createDefaultPlan(moduleBase);
            if (defaultPlan != null) {
                return defaultPlan;
            }
        } catch (MalformedURLException e) {
        }
View Full Code Here

        if (applicationDoc == null) {
            return null;
        }

        // construct the empty geronimo-application.xml
        GerApplicationDocument gerApplicationDocument = GerApplicationDocument.Factory.newInstance();
        GerApplicationType gerApplication = gerApplicationDocument.addNewApplication();

        // set the parentId and configId
        gerApplication.setParentId(PARENT_ID);
        String id = applicationDoc.getApplication().getId();
        if (id == null) {
View Full Code Here

                callback.copyOverContent(earContext, moduleLocations);
            }

            // add dependencies declared in the geronimo-application.xml
            if (plan instanceof GerApplicationDocument) {
                GerApplicationDocument applicationDoc = (GerApplicationDocument) plan;
                GerApplicationType geronimoApplication = applicationDoc.getApplication();
                GerDependencyType[] dependencies = geronimoApplication.getDependencyArray();
                for (int i = 0; i < dependencies.length; i++) {
                    earContext.addDependency(getDependencyURI(dependencies[i]));
                }
            }

            // each module installs it's files into the output context.. this is differenct for each module type
            for (Iterator iterator = modules.iterator(); iterator.hasNext();) {
                Module module = (Module) iterator.next();
                callback.installModule(getBuilder(module), earContext, module);
            }

            // give each module a chance to populate the earContext now that a classloader is available
            ClassLoader cl = earContext.getClassLoader(repository);
            for (Iterator iterator = modules.iterator(); iterator.hasNext();) {
                Module module = (Module) iterator.next();
                getBuilder(module).initContext(earContext, module, cl);
            }

            // add gbeans declared in the geronimo-application.xml
            if (plan instanceof GerApplicationDocument) {
                GerApplicationDocument applicationDoc = (GerApplicationDocument) plan;
                GerApplicationType geronimoApplication = applicationDoc.getApplication();
                GerGbeanType[] gbeans = geronimoApplication.getGbeanArray();
                for (int i = 0; i < gbeans.length; i++) {
                    GBeanHelper.addGbean(new GerGBeanAdapter(gbeans[i]), cl, earContext);
                }
            }
View Full Code Here

                        currentModule.setAltSpecDD(altDDURL);
                    }
                }
            }
           
            GerApplicationDocument gerApplication = (GerApplicationDocument) plan;
            GerModuleType gerModuleTypes[] = gerApplication.getApplication().getModuleArray();
            for (int i = 0; i < gerModuleTypes.length; i++) {
                GerModuleType gerModuleType = gerModuleTypes[i];
                Module currentModule = null;
                if ( gerModuleType.isSetEjb() ) {
                    currentModule = (Module) moduleMap.get(gerModuleType.getEjb().getStringValue());
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.