Examples of EnvironmentType


Examples of org.apache.geronimo.deployment.xbeans.EnvironmentType

                id = id.substring(0, id.length() - 1);
            }
        }

        GerApplicationClientType geronimoAppClient = GerApplicationClientType.Factory.newInstance();
        EnvironmentType clientEnvironmentType = geronimoAppClient.addNewClientEnvironment();
        EnvironmentType serverEnvironmentType = geronimoAppClient.addNewServerEnvironment();
        //TODO configid fill in environment with configids
        // set the parentId and configId
//        if (standAlone) {
//            geronimoAppClient.setClientConfigId(id);
//            geronimoAppClient.setConfigId(id + "/server");
View Full Code Here

Examples of org.apache.geronimo.deployment.xbeans.EnvironmentType

        }
        return environment;
    }

    public static EnvironmentType buildEnvironmentType(Environment environment) {
        EnvironmentType environmentType = EnvironmentType.Factory.newInstance();
        if (environment.getConfigId() != null) {
            ArtifactType configId = toArtifactType(environment.getConfigId());
            environmentType.setModuleId(configId);
        }

        List dependencies = toDependencyTypes(environment.getDependencies());
        DependencyType[] dependencyTypes = (DependencyType[]) dependencies.toArray(new DependencyType[dependencies.size()]);
        DependenciesType dependenciesType = environmentType.addNewDependencies();
        dependenciesType.setDependencyArray(dependencyTypes);
        if (environment.isInverseClassLoading()) {
            environmentType.addNewInverseClassloading();
        }
        if (environment.isSuppressDefaultEnvironment()) {
            environmentType.addNewSuppressDefaultEnvironment();
        }
        environmentType.setHiddenClasses(toFilterType(environment.getHiddenClasses()));
        environmentType.setNonOverridableClasses(toFilterType(environment.getNonOverrideableClasses()));
        return environmentType;
    }
View Full Code Here

Examples of org.apache.geronimo.deployment.xbeans.EnvironmentType

        return NAMESPACE;
    }

    public Object getValue(XmlObject xmlObject, String type, ClassLoader cl) throws DeploymentException {

        EnvironmentType environmentType;
        if (xmlObject instanceof EnvironmentType) {
            environmentType = (EnvironmentType) xmlObject;
        } else {
            environmentType = (EnvironmentType) xmlObject.copy().changeType(EnvironmentType.type);
        }
        try {
            XmlOptions xmlOptions = new XmlOptions();
            xmlOptions.setLoadLineNumbers();
            Collection errors = new ArrayList();
            xmlOptions.setErrorListener(errors);
            if (!environmentType.validate(xmlOptions)) {
                throw new XmlException("Invalid deployment descriptor: " + errors + "\nDescriptor: " + environmentType.toString(), null, errors);
            }
        } catch (XmlException e) {
            throw new DeploymentException(e);
        }
View Full Code Here

Examples of org.apache.geronimo.deployment.xbeans.EnvironmentType

        return buildEnvironment(environmentType);
    }

    public String getAsText() {
        Environment environment = (Environment) getValue();
        EnvironmentType environmentType = buildEnvironmentType(environment);
        XmlOptions xmlOptions = new XmlOptions();
        xmlOptions.setSaveSyntheticDocumentElement(QNAME);
        xmlOptions.setSavePrettyPrint();
        return environmentType.xmlText(xmlOptions);
    }
View Full Code Here

Examples of org.apache.geronimo.deployment.xbeans.EnvironmentType

    }

    public void setAsText(String text) {
        try {
            EnvironmentDocument environmentDocument = EnvironmentDocument.Factory.parse(text);
            EnvironmentType environmentType = environmentDocument.getEnvironment();
            Environment environment = (Environment) getValue(environmentType, null, null);
            setValue(environment);

        } catch (XmlException e) {
            throw new PropertyEditorException(e);
View Full Code Here

Examples of org.apache.geronimo.deployment.xbeans.EnvironmentType

            SchemaConversionUtils.validateDD(gerConnector);
        } catch (XmlException e) {
            throw new DeploymentException(e);
        }

        EnvironmentType environmentType = gerConnector.getEnvironment();
        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
        if (earEnvironment != null) {
            EnvironmentBuilder.mergeEnvironments(earEnvironment, environment);
            environment = earEnvironment;
            if(!environment.getConfigId().isResolved()) {
View Full Code Here

Examples of org.apache.geronimo.deployment.xbeans.EnvironmentType

        if (parentId != null) {
            environment.addDependency(parentId, ImportType.ALL);
        }
        environment.setSuppressDefaultEnvironment(suppressDefaultEnvironment);
        extractDependencies(cursor, environment);
        EnvironmentType environmentType = EnvironmentBuilder.buildEnvironmentType(environment);
        cursor.beginElement(environmentQname);
        XmlCursor element = environmentType.newCursor();
        try {
            element.copyXmlContents(cursor);
        } finally {
            element.dispose();
        }
View Full Code Here

Examples of org.apache.geronimo.deployment.xbeans.EnvironmentType

        }
    }

    public Artifact getConfigurationID(Object plan, JarFile module, ModuleIDBuilder idBuilder) throws IOException, DeploymentException {
        ModuleType configType = (ModuleType) plan;
        EnvironmentType environmentType = configType.getEnvironment();
        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
        idBuilder.resolve(environment, module == null ? "" : new File(module.getName()).getName(), "car");
        if(!environment.getConfigId().isResolved()) {
            throw new IllegalStateException("Service Module ID is not fully populated ("+environment.getConfigId()+")");
        }
View Full Code Here

Examples of org.apache.geronimo.deployment.xbeans.EnvironmentType

            }
        }

        contextRoot = contextRoot.trim();

        EnvironmentType environmentType = jettyWebApp.getEnvironment();
        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
        // Note: logic elsewhere depends on the default artifact ID being the file name less extension (ConfigIDExtractor)
        String warName = new File(moduleFile.getName()).getName();
        if(warName.lastIndexOf('.') > -1) {
            warName = warName.substring(0, warName.lastIndexOf('.'));
View Full Code Here

Examples of org.apache.geronimo.deployment.xbeans.EnvironmentType

        QName childName = xmlCursor.getName();
        Environment oldEnvironment;
        if (childName != null && childName.getLocalPart().equals(ENVIRONMENT_LOCAL_NAME)) {
            convertElement(xmlCursor, ENVIRONMENT_QNAME.getNamespaceURI());
            XmlObject xmlObject = xmlCursor.getObject();
            EnvironmentType environmentType = (EnvironmentType) xmlObject.copy().changeType(EnvironmentType.type);
            oldEnvironment = EnvironmentBuilder.buildEnvironment(environmentType);
            xmlCursor.removeXml();
        } else {
            oldEnvironment = new Environment();
        }


        Environment newEnvironment = new Environment();
        newEnvironment.setConfigId(configId);
        newEnvironment.setDependencies(dependencies);

        EnvironmentBuilder.mergeEnvironments(oldEnvironment, newEnvironment);
        EnvironmentType environmentType = EnvironmentBuilder.buildEnvironmentType(oldEnvironment);

        xmlCursor.beginElement(ENVIRONMENT_QNAME);
        XmlCursor element = environmentType.newCursor();
        try {
            element.copyXmlContents(xmlCursor);
        } finally {
            element.dispose();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.