Package org.apache.geronimo.deployment

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


                naming,
                artifactResolvers,
                bundleContext);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(resolveFile("src/test/resources/plans/test-bad-war.xml"), earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            //we now may get a FileNotFoundException for missing wars.
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                FileUtils.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here


                naming,
                artifactResolvers,
                bundleContext);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(resolveFile("src/test/resources/plans/test-bad-rar.xml"), earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            //we now may get a FileNotFoundException for missing wars.
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                FileUtils.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                naming,
                artifactResolvers,
                bundleContext);

        ConfigurationData configurationData = null;
        DeploymentContext context = null;
        try {
            Object plan = configBuilder.getDeploymentPlan(resolveFile("src/test/resources/plans/test-bad-car.xml"), earFile, idBuilder);
            context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, earFile, idBuilder), plan, earFile, Collections.singleton(configStore), artifactResolver, configStore);
            configurationData = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            //we now may get a FileNotFoundException for missing wars.
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                FileUtils.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                artifactResolvers,
                bundleContext);


        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 = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            // expected
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                FileUtils.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                naming,
                artifactResolvers,
                bundleContext);

        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 = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            // expected
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                FileUtils.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

                naming,
                artifactResolvers,
                bundleContext);

        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 = getConfigurationData(context);
            fail("Should have thrown a DeploymentException");
        } catch (DeploymentException e) {
            // expected
        } finally {
            if (context != null) {
                context.close();
            }
            if (configurationData != null) {
                FileUtils.recursiveDelete(configurationData.getConfigurationDir());
            }
        }
View Full Code Here

        if (location == null) {
            throw new DeploymentException("Endpoint URI for EJB WebService is missing");
        }

        Map<String, PortInfo> ejbNamePortInfoMap = null;
        DeploymentContext context = module.getEarContext();
        AbstractName jaxwsEJBApplicationContextName = context.getNaming().createChildName(module.getModuleName(), "JAXWSEJBApplicationContext", "JAXWSEJBApplicationContext");
        try {
            ejbNamePortInfoMap = (Map<String, PortInfo>)(context.getGBeanInstance(jaxwsEJBApplicationContextName).getAttribute("ejbNamePortInfoMap"));
        } catch (GBeanNotFoundException e) {
            GBeanData jaxwsEJBApplicationContextGBeanData = new GBeanData(jaxwsEJBApplicationContextName, JAXWSEJBApplicationContext.class);
            try {
                context.addGBean(jaxwsEJBApplicationContextGBeanData);
            } catch (GBeanAlreadyExistsException e1) {
            }
            ejbNamePortInfoMap = new HashMap<String, PortInfo>();
            jaxwsEJBApplicationContextGBeanData.setAttribute("ejbNamePortInfoMap", ejbNamePortInfoMap);
        }
View Full Code Here

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

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

                    kernel.getNaming(),
                    null,
                    bundleContext);
            configBuilder.doStart();
            ConfigurationData configData = null;
            DeploymentContext context = null;
            ArtifactManager artifactManager = new DefaultArtifactManager();
            ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, repository);

            try {
                File planFile = new File(BASEDIR, "src/test/resources/data/external-application-plan.xml");
                ModuleIDBuilder idBuilder = new ModuleIDBuilder();
                Object plan = configBuilder.getDeploymentPlan(planFile, rarFile, idBuilder);
                context = configBuilder.buildConfiguration(false, configBuilder.getConfigurationID(plan, rarFile, idBuilder), plan, rarFile, Collections.singleton(configurationStore), artifactResolver, configurationStore);
                // add the a j2ee server so the application context reference can be resolved
                context.addGBean("geronimo", J2EEServerImpl.GBEAN_INFO);
                // add the module validator so the connector artifacts will resolve to an instance
                AbstractName abstractName = context.getNaming().createChildName(((Module)plan).getModuleName(), "ValidatorFactory", NameFactory.VALIDATOR_FACTORY);
                GBeanData gbeanData = new GBeanData(abstractName, ValidatorFactoryGBean.class);
                context.addGBean(gbeanData);
                configData = context.getConfigurationData();
            } finally {
                if (context != null) {
                    context.close();
                }
                if (configData != null) {
                    FileUtils.recursiveDelete(configData.getConfigurationDir());
                }
            }
View Full Code Here

        outFile.delete();
        if (!outFile.mkdirs()) {
            fail("could not create temp dir");
        }
        try {
            DeploymentContext context = new DeploymentContext(outFile, URI.create("foo/bar"), ConfigurationModuleType.SERVICE, parentId, "domain", "server", null);
            J2eeContext j2eeContext = new J2eeContextImpl("domain", "server", "null", "test", "configtest", "foo", NameFactory.J2EE_MODULE);
            GbeanType[] gbeans = plan.getGbeanArray();
            ServiceConfigBuilder.addGBeans(gbeans, cl, j2eeContext, context);
            Set beanDatas = context.listGBeans(new ObjectName("*:*"));
            assertEquals(1, beanDatas.size());
            ObjectName beanName = (ObjectName) beanDatas.iterator().next();
            GBeanData data = context.getGBeanInstance(beanName);
            FooBarBean fooBarBean = (FooBarBean) data.getAttribute("fooBarBean");
            assertNotNull(fooBarBean);
            assertEquals("foo", fooBarBean.getFoo());
            assertEquals(10, fooBarBean.getBar());
            FooBarBean inner = fooBarBean.getBean();
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.