Package org.apache.geronimo.deployment

Examples of org.apache.geronimo.deployment.DeploymentContext$JarFileFactory


        Jsr77Naming naming = new Jsr77Naming();
        ArtifactManager artifactManager = new DefaultArtifactManager();
        ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.EMPTY_SET, null);
        ConfigurationManager configurationManager = new SimpleConfigurationManager(Collections.EMPTY_SET, artifactResolver, Collections.EMPTY_SET);
        AbstractName moduleName = naming.createRootName(configID, "testejb", NameFactory.EJB_MODULE);
        context = new DeploymentContext(tmpbasedir, null, environment, moduleName, ConfigurationModuleType.CAR, naming, configurationManager, Collections.EMPTY_SET);

        File moduleLocation = new File(tmpbasedir, "ejb");
        moduleLocation.mkdirs();
        module = new EJBModule(true, moduleName, environment, new UnpackedJarFile(moduleLocation), "ejb", null, null, null, null);
View Full Code Here


        LoginConfigBuilder builder = new LoginConfigBuilder(new Jsr77Naming(), null);
        XmlObject xmlObject = XmlBeansUtil.parse(text);
        XmlCursor cursor = xmlObject.newCursor();
        cursor.toFirstContentToken();
        xmlObject = cursor.getObject();
        DeploymentContext context = new DeploymentContext(new File("."), null, new Environment(Artifact.create("test/foo/1.0/car")), null, ConfigurationModuleType.SERVICE, new Jsr77Naming(), new MockConfigurationManager(), Collections.emptySet());
        AbstractName parentName = new AbstractName(URI.create("test/foo/1.0/car?name=parent,j2eeType=foo"));
        builder.getReferences(xmlObject, context, parentName, getClass().getClassLoader());
        secBuilder.doStop();
    }
View Full Code Here

    protected void setUp() throws Exception {
        tmpbasedir = File.createTempFile("car", "tmp");
        tmpbasedir.delete();
        tmpbasedir.mkdirs();
        context = new DeploymentContext(tmpbasedir, configID, ConfigurationModuleType.CAR, null, "foo", "geronimo", null);

        File moduleLocation = new File(tmpbasedir, "ejb");
        moduleLocation.mkdirs();
        module = new EJBModule(true, configID, null, new UnpackedJarFile(moduleLocation), "ejb", null, null, null);
View Full Code Here

            configID = new URI(properties.getProperty("configID"));
        } catch (URISyntaxException e1) {
            throw new DeploymentException("Invalid configuration URI", e1);
        }

        DeploymentContext context = null;
        context = new DeploymentContext(outfile, configID, ConfigurationModuleType.SERVICE, parentID, null, null, kernel);

        // Copy over all files.
        for (Enumeration e = module.entries(); e.hasMoreElements();) {
            ZipEntry entry = (ZipEntry) e.nextElement();
            context.addFile(URI.create(entry.getName()), module, entry);
        }

        // Create the JBI deployment managed object
        try {
            Properties props = new Properties();
            props.put("jbiType", "Deployment");
            props.put("name", configID.toString());
            ObjectName name = ObjectName.getInstance(context.getDomain(), props);
            GBeanData gbeanData = new GBeanData(name, ServiceMixDeployment.GBEAN_INFO);

            context.addGBean(gbeanData);
        } catch (MalformedObjectNameException e) {
            throw new DeploymentException("Invalid gbean name: " + e, e);
        }

        if (deploymentDependencies != null) {
            String[] strings = deploymentDependencies.split("\\,");
            for (int i = 0; i < strings.length; i++) {
                strings[i] = strings[i].trim();
                if (strings[i].length() > 0) {
                    try {
                        context.addDependency(new URI(strings[i]));
                    } catch (URISyntaxException e) {
                        throw new DeploymentException("Invalid dependency URI: " + strings[i], e);
                    }
                }
            }
        }

        context.close();
        ConfigurationData configurationData = context.getConfigurationData();
        try {
            configurationData.addClassPathLocation(new URI("."));
        } catch (URISyntaxException e) {
            throw new DeploymentException("Could not set classpath: " + e, e);
        }
View Full Code Here

        return suite;
    }

    public void testBuildConfiguration() throws Exception {
        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId,
                    transactionContextManagerAbstractNameQuery,
                    connectionTrackerAbstractNameQuery,
                    transactionalTimerAbstractNameQuery,
                    nonTransactionalTimerAbstractNameQuery,
                    corbaGBeanAbstractNameQuery,
                    null,
                    null,
                    ejbConfigBuilder,
                    ejbConfigBuilder,
                    webConfigBuilder,
                    connectorConfigBuilder,
                    resourceReferenceBuilder,
                    appClientConfigBuilder,
                    serviceReferenceBuilder,
                    naming);

            Object plan = configBuilder.getDeploymentPlan(null, earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = context.getConfigurationData();
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                appClientConfigBuilder,
                serviceReferenceBuilder,
                naming);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-ejb-jar.xml"), earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = context.getConfigurationData();
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            if (e.getCause() instanceof IOException) {
                fail("Should not be complaining about bad vendor DD for invalid module entry");
            }
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                appClientConfigBuilder,
                serviceReferenceBuilder,
                naming);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-war.xml"), earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = context.getConfigurationData();
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            if (e.getCause() instanceof IOException) {
                fail("Should not be complaining about bad vendor DD for invalid module entry");
            }
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                appClientConfigBuilder,
                serviceReferenceBuilder,
                naming);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-rar.xml"), earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = context.getConfigurationData();
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            if (e.getCause() instanceof IOException) {
                fail("Should not be complaining about bad vendor DD for invalid module entry");
            }
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                appClientConfigBuilder,
                serviceReferenceBuilder,
                naming);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(new File(basedir, "target/plans/test-bad-car.xml"), earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = context.getConfigurationData();
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            if (e.getCause() instanceof IOException) {
                fail("Should not be complaining about bad vendor DD for invalid module entry");
            }
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                serviceReferenceBuilder,
                naming);


        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(null, earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = context.getConfigurationData();
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            // expected
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.deployment.DeploymentContext$JarFileFactory

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.