Package org.apache.geronimo.j2ee.deployment

Examples of org.apache.geronimo.j2ee.deployment.ModuleBuilder


        String j2eeApplicationName = "null";
        String j2eeModuleName = "org/apache/geronimo/j2ee/deployment/test";
        String resourceAdapterName = "testRA";
        ObjectName connectionTrackerName = new ObjectName("geronimo.connector:service=ConnectionTracker");

        ModuleBuilder moduleBuilder = new ConnectorModuleBuilder();
        File rarFile = action.getRARFile();

        ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
        ClassLoader cl = new URLClassLoader(new URL[]{rarFile.toURL()}, oldCl);

        Thread.currentThread().setContextClassLoader(cl);

        XmlObject plan = moduleBuilder.getDeploymentPlan(rarFile.toURL());
        URI parentId = moduleBuilder.getParentId(plan);
        URI configId = moduleBuilder.getConfigId(plan);
        assertEquals(j2eeModuleName, configId.toString());

        Module module = moduleBuilder.createModule(configId.toString(), plan);

        File carFile = File.createTempFile("RARTest", ".car");
        try {
            EARContext earContext = new EARContext(new JarOutputStream(new FileOutputStream(carFile)),
                    configId,
                    ConfigurationModuleType.RAR,
                    parentId,
                    null,
                    j2eeDomainName,
                    j2eeServerName,
                    j2eeApplicationName,
                    null,
                    connectionTrackerName,
                    null,
                    null,
                    null);

            action.install(moduleBuilder, earContext, module);
            earContext.getClassLoader(null);
            moduleBuilder.initContext(earContext, module, cl);
            moduleBuilder.addGBeans(earContext, module, cl);
            earContext.close();

            File tempdir = new File(System.getProperty("java.io.tmpdir"));
            File unpackedDir = new File(tempdir, "OpenEJBTest-Unpacked");
            LocalConfigStore.unpack(unpackedDir, new FileInputStream(carFile));
View Full Code Here


        String j2eeServerName = "TestGeronimoServer";
        String j2eeApplicationName = "null";
        String j2eeModuleName = "org/apache/geronimo/j2ee/deployment/test";
        ObjectName connectionTrackerName = new ObjectName("geronimo.connector:service=ConnectionTracker");

        ModuleBuilder moduleBuilder = new ConnectorModuleBuilder();
        File rarFile = action.getRARFile();

        ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
        ClassLoader cl = new URLClassLoader(new URL[]{rarFile.toURL()}, oldCl);

        Thread.currentThread().setContextClassLoader(cl);

        XmlObject plan = moduleBuilder.getDeploymentPlan(rarFile.toURL());
        URI parentId = moduleBuilder.getParentId(plan);
        URI configId = moduleBuilder.getConfigId(plan);
        assertEquals(j2eeModuleName, configId.toString());

        Module module = moduleBuilder.createModule(configId.toString(), plan);

        File carFile = File.createTempFile("RARTest", ".car");
        try {
            EARContext earContext = new EARContext(new JarOutputStream(new FileOutputStream(carFile)),
                    configId,
                    ConfigurationModuleType.RAR,
                    parentId,
                    null,
                    j2eeDomainName,
                    j2eeServerName,
                    j2eeApplicationName,
                    null,
                    connectionTrackerName,
                    null,
                    null,
                    null);

            action.install(moduleBuilder, earContext, module);
            earContext.getClassLoader(null);
            moduleBuilder.initContext(earContext, module, cl);
            moduleBuilder.addGBeans(earContext, module, cl);
            earContext.close();

            File tempdir = new File(System.getProperty("java.io.tmpdir"));
            File unpackedDir = new File(tempdir, "OpenEJBTest-Unpacked");
            LocalConfigStore.unpack(unpackedDir, new FileInputStream(carFile));
View Full Code Here

TOP

Related Classes of org.apache.geronimo.j2ee.deployment.ModuleBuilder

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.