Package org.apache.geronimo.deployment.service.jsr88

Examples of org.apache.geronimo.deployment.service.jsr88.EnvironmentData


                final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
                ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(
                        ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);

                EnvironmentData environment = new EnvironmentData();
                connector.setEnvironment(environment);
                org.apache.geronimo.deployment.service.jsr88.Artifact configId = new org.apache.geronimo.deployment.service.jsr88.Artifact();
                environment.setConfigId(configId);
                configId.setGroupId("console.dbpool");
                configId.setVersion("1.0");
                configId.setType("car");
               
                String artifactId = data.name;
                // simply replace / with _ if / exists within the artifactId
                // this is needed because we don't allow / within the artifactId
                artifactId = artifactId.replace('/', '_');

                // Let's check whether the artifact exists
                ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(PortletManager.getKernel());
                if (configurationManager.isInstalled(new Artifact(configId.getGroupId(), artifactId,
                        configId.getVersion(), configId.getType()))) {
                    artifactId = artifactId + "_" + new Random(System.currentTimeMillis()).nextInt(99);
                }

                configId.setArtifactId(artifactId);

                String[] jars = data.getJars();
                int length = jars[jars.length - 1].length() == 0 ? jars.length - 1 : jars.length;
                org.apache.geronimo.deployment.service.jsr88.Artifact[] dependencies = new org.apache.geronimo.deployment.service.jsr88.Artifact[length];
                for (int i = 0; i < dependencies.length; i++) {
                    dependencies[i] = new org.apache.geronimo.deployment.service.jsr88.Artifact();
                }
                environment.setDependencies(dependencies);
                for (int i = 0; i < dependencies.length; i++) {
                    Artifact tmp = Artifact.create(jars[i]);
                    dependencies[i].setGroupId(tmp.getGroupId());
                    dependencies[i].setArtifactId(tmp.getArtifactId());
                    dependencies[i].setVersion(tmp.getVersion().toString());
View Full Code Here


    public EnvironmentData getEnvironment() {
        return environment;
    }

    public void setEnvironment(EnvironmentData environment) {
        EnvironmentData old = this.environment;
        this.environment = environment;
        if((old == null && environment == null) || (old != null&& old == environment)) {
            return;
        }
        if(old != null) {
View Full Code Here

        assertEquals("connector", dcbRoot.getXpaths()[0]);
        // Try the /connector element
        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
        assertNotNull(connector);
        assertNull(connector.getEnvironment());
        EnvironmentData environment = new EnvironmentData();
        connector.setEnvironment(environment);
        Artifact configId = new Artifact();
        environment.setConfigId(configId);
        assertNull(configId.getArtifactId());
        assertNull(configId.getGroupId());
        assertNull(configId.getType());
        assertNull(configId.getVersion());
        configId.setGroupId("test");
        configId.setArtifactId("product");
        configId.setType("rar");
        configId.setVersion("1.0");
        Artifact parent = new Artifact();
        Artifact dependency = new Artifact();
        environment.setDependencies(new Artifact[]{parent, dependency});
        assertNull(parent.getArtifactId());
        assertNull(parent.getGroupId());
        assertNull(parent.getType());
        assertNull(parent.getVersion());
        assertNull(dependency.getArtifactId());
View Full Code Here

    public EnvironmentData getEnvironment() {
        return environment;
    }

    public void setEnvironment(EnvironmentData environment) {
        EnvironmentData old = this.environment;
        this.environment = environment;
        if ((old == null && environment == null) || (old != null && old == environment)) {
            return;
        }
        if (old != null) {
View Full Code Here

                final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
                ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(
                        ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);

                EnvironmentData environment = new EnvironmentData();
                connector.setEnvironment(environment);
                org.apache.geronimo.deployment.service.jsr88.Artifact configId = new org.apache.geronimo.deployment.service.jsr88.Artifact();
                environment.setConfigId(configId);
                configId.setGroupId("console.dbpool");
                String artifactId = data.name;
                if (artifactId.indexOf('/') != -1) {
                    // slash in artifact-id results in invalid configuration-id and leads to deployment errors
                    // use the after / portion as the artifactId
                    artifactId = artifactId.substring(artifactId.indexOf('/') + 1);
                }
                configId.setArtifactId(artifactId);
                configId.setVersion("1.0");
                configId.setType("rar");

                String[] jars = data.getJars();
                int length = jars[jars.length - 1].length() == 0 ? jars.length - 1 : jars.length;
                org.apache.geronimo.deployment.service.jsr88.Artifact[] dependencies = new org.apache.geronimo.deployment.service.jsr88.Artifact[length];
                for (int i = 0; i < dependencies.length; i++) {
                    dependencies[i] = new org.apache.geronimo.deployment.service.jsr88.Artifact();
                }
                environment.setDependencies(dependencies);
                for (int i = 0; i < dependencies.length; i++) {
                    Artifact tmp = Artifact.create(jars[i]);
                    dependencies[i].setGroupId(tmp.getGroupId());
                    dependencies[i].setArtifactId(tmp.getArtifactId());
                    dependencies[i].setVersion(tmp.getVersion().toString());
View Full Code Here

        WebAppDConfigRoot configRoot = (WebAppDConfigRoot) deploymentConfiguration.getDConfigBeanRoot(ddBeanRoot);
        WebAppDConfigBean webApp = (WebAppDConfigBean) configRoot.getDConfigBean(ddBean);

        webApp.setContextRoot(data.getContextRoot());

        EnvironmentData environment = new EnvironmentData();
        webApp.setEnvironment(environment);
        org.apache.geronimo.deployment.service.jsr88.Artifact configId = new org.apache.geronimo.deployment.service.jsr88.Artifact();
        environment.setConfigId(configId);
        configId.setGroupId(data.getGroupId());
        configId.setArtifactId(data.getArtifactId());
        configId.setVersion(data.getVersion());
        configId.setType(data.getType());
        int numDependencies = data.getDependencies().size();
        if (numDependencies > 0) {
            org.apache.geronimo.deployment.service.jsr88.Artifact[] dependencies = new org.apache.geronimo.deployment.service.jsr88.Artifact[numDependencies];
            for (int i = 0; i < numDependencies; i++) {
                dependencies[i] = new org.apache.geronimo.deployment.service.jsr88.Artifact();
            }
            environment.setDependencies(dependencies);
            for (int i = 0; i < numDependencies; i++) {
                Artifact artifact = Artifact.create(((String) data.getDependencies().get(i)).trim());
                org.apache.geronimo.deployment.service.jsr88.Artifact dep = dependencies[i];
                dep.setArtifactId(artifact.getArtifactId());
                if (artifact.getGroupId() != null) {
                    dep.setGroupId(artifact.getGroupId());
                }
                if (artifact.getType() != null) {
                    dep.setType(artifact.getType());
                }
                if (artifact.getVersion() != null) {
                    dep.setVersion(artifact.getVersion().toString());
                }
            }
        }
        String hiddenClassesString = data.getHiddenClasses();
        if (hiddenClassesString != null && hiddenClassesString.length() > 0) {
            String[] hiddenClasses = getNonEmptyStrings(hiddenClassesString.split(";"));
            if (hiddenClasses.length > 0) {
                environment.setHiddenClasses(hiddenClasses);
            }
        }
        String nonOverridableClassesString = data.getNonOverridableClasses();
        if (nonOverridableClassesString != null && nonOverridableClassesString.length() > 0) {
            String[] nonOverridableClasses = getNonEmptyStrings(nonOverridableClassesString.split(";"));
            if (nonOverridableClasses.length > 0) {
                environment.setNonOverridableClasses(nonOverridableClasses);
            }
        }
        if (data.isInverseClassLoading()) {
            environment.setInverseClassLoading(true);
        }

        int numEjbRefs = data.getEjbRefs().size();
        if (numEjbRefs > 0) {
            EjbRef[] ejbRefs = new EjbRef[numEjbRefs];
View Full Code Here

        assertEquals("connector", dcbRoot.getXpaths()[0]);
        // Try the /connector element
        ConnectorDCB connector = (ConnectorDCB) dcbRoot.getDConfigBean(root.getChildBean(dcbRoot.getXpaths()[0])[0]);
        assertNotNull(connector);
        assertNull(connector.getEnvironment());
        EnvironmentData environment = new EnvironmentData();
        connector.setEnvironment(environment);
        Artifact configId = new Artifact();
        environment.setConfigId(configId);
        assertNull(configId.getArtifactId());
        assertNull(configId.getGroupId());
        assertNull(configId.getType());
        assertNull(configId.getVersion());
        configId.setGroupId("test");
        configId.setArtifactId("product");
        configId.setType("rar");
        configId.setVersion("1.0");
        Artifact parent = new Artifact();
        Artifact dependency = new Artifact();
        environment.setDependencies(new Artifact[]{parent, dependency});
        assertNull(parent.getArtifactId());
        assertNull(parent.getGroupId());
        assertNull(parent.getType());
        assertNull(parent.getVersion());
        assertNull(dependency.getArtifactId());
View Full Code Here

    public EnvironmentData getEnvironment() {
        return environment;
    }

    public void setEnvironment(EnvironmentData environment) {
        EnvironmentData old = this.environment;
        this.environment = environment;
        if((old == null && environment == null) || (old != null&& old == environment)) {
            return;
        }
        if(old != null) {
View Full Code Here

                final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
                ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(
                        ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);

                EnvironmentData environment = new EnvironmentData();
                connector.setEnvironment(environment);
                org.apache.geronimo.deployment.service.jsr88.Artifact configId = new org.apache.geronimo.deployment.service.jsr88.Artifact();
                environment.setConfigId(configId);
                configId.setGroupId("console.dbpool");
                configId.setVersion("1.0");
                configId.setType("car");
               
                String artifactId = data.name;
                // simply replace / with _ if / exists within the artifactId
                // this is needed because we don't allow / within the artifactId
                artifactId = artifactId.replace('/', '_');

                // Let's check whether the artifact exists
                ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(PortletManager.getKernel());
                if (configurationManager.isInstalled(new Artifact(configId.getGroupId(), artifactId,
                        configId.getVersion(), configId.getType()))) {
                    artifactId = artifactId + "_" + new Random(System.currentTimeMillis()).nextInt(99);
                }

                configId.setArtifactId(artifactId);

                String[] jars = data.getJars();
                int length = jars[jars.length - 1].length() == 0 ? jars.length - 1 : jars.length;
                org.apache.geronimo.deployment.service.jsr88.Artifact[] dependencies = new org.apache.geronimo.deployment.service.jsr88.Artifact[length];
                for (int i = 0; i < dependencies.length; i++) {
                    dependencies[i] = new org.apache.geronimo.deployment.service.jsr88.Artifact();
                }
                environment.setDependencies(dependencies);
                for (int i = 0; i < dependencies.length; i++) {
                    Artifact tmp = Artifact.create(jars[i]);
                    dependencies[i].setGroupId(tmp.getGroupId());
                    dependencies[i].setArtifactId(tmp.getArtifactId());
                    dependencies[i].setVersion(tmp.getVersion().toString());
View Full Code Here

                final DDBeanRoot ddBeanRoot = deployable.getDDBeanRoot();
                Connector15DCBRoot root = (Connector15DCBRoot) config.getDConfigBeanRoot(ddBeanRoot);
                ConnectorDCB connector = (ConnectorDCB) root.getDConfigBean(
                        ddBeanRoot.getChildBean(root.getXpaths()[0])[0]);

                EnvironmentData environment = new EnvironmentData();
                connector.setEnvironment(environment);
                org.apache.geronimo.deployment.service.jsr88.Artifact configId = new org.apache.geronimo.deployment.service.jsr88.Artifact();
                environment.setConfigId(configId);
                configId.setGroupId("console.dbpool");
                configId.setVersion("1.0");
                configId.setType("car");
               
                String artifactId = data.name;
                // simply replace / with _ if / exists within the artifactId
                // this is needed because we don't allow / within the artifactId
                artifactId = artifactId.replace('/', '_');

                // Let's check whether the artifact exists
                ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(PortletManager.getKernel());
                if (configurationManager.isInstalled(new Artifact(configId.getGroupId(), artifactId,
                        configId.getVersion(), configId.getType()))) {
                    artifactId = artifactId + "_" + new Random(System.currentTimeMillis()).nextInt(99);
                }

                configId.setArtifactId(artifactId);

                String[] jars = data.getJars();
                int length = jars[jars.length - 1].length() == 0 ? jars.length - 1 : jars.length;
                org.apache.geronimo.deployment.service.jsr88.Artifact[] dependencies = new org.apache.geronimo.deployment.service.jsr88.Artifact[length];
                for (int i = 0; i < dependencies.length; i++) {
                    dependencies[i] = new org.apache.geronimo.deployment.service.jsr88.Artifact();
                }
                environment.setDependencies(dependencies);
                for (int i = 0; i < dependencies.length; i++) {
                    Artifact tmp = Artifact.create(jars[i]);
                    dependencies[i].setGroupId(tmp.getGroupId());
                    dependencies[i].setArtifactId(tmp.getArtifactId());
                    dependencies[i].setVersion(tmp.getVersion().toString());
View Full Code Here

TOP

Related Classes of org.apache.geronimo.deployment.service.jsr88.EnvironmentData

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.