Package org.apache.geronimo.openejb

Examples of org.apache.geronimo.openejb.OpenEjbSystem


        }

        Properties props = null;
        Container container = containerSystem.getContainer(containerId);
        if (container.getContainerType() == ContainerType.MESSAGE_DRIVEN) {
            OpenEjbSystem openEjbSystem = null;
            AbstractNameQuery absQuery = new AbstractNameQuery(
                    OpenEjbSystem.class.getName());
            Set<AbstractName> systemGBeans = kernel.listGBeans(absQuery);
            for (AbstractName absName : systemGBeans) {
                openEjbSystem = kernel.getProxyManager()
                        .createProxy(absName, OpenEjbSystem.class);
                props = openEjbSystem.getProperties();
                if (props == null) {
                    props = new Properties();
                }
                props.put(containerId + "." + propertyKey, propertyValue);
                openEjbSystem.setProperties(props);
                getGBeanDataFromConfiguration(absName).setAttribute("properties", props);

            }
        } else {
            AbstractNameQuery absQuery = new AbstractNameQuery(
View Full Code Here


        File file = new File(System.getProperty("user.home") + "/.m2/repository/org/apache/openejb/openejb-itests-beans/3.0-incubating-SNAPSHOT/openejb-itests-beans-3.0-incubating-SNAPSHOT.jar");
        if (!file.canRead()) return;
        JarFile moduleFile = new JarFile(file);

        TransactionManager transactionManager = new GeronimoTransactionManager();
        OpenEjbSystem openEjbSystem = new OpenEjbSystemGBean(transactionManager);

        addEjbContainer(openEjbSystem, "Default Stateless Container", "STATELESS");
        addEjbContainer(openEjbSystem, "Default Stateful Container", "STATEFUL");
        addEjbContainer(openEjbSystem, "Default BMP Container", "BMP_ENTITY");
        addEjbContainer(openEjbSystem, "Default CMP Container", "CMP_ENTITY");
        addEjbContainer(openEjbSystem, "Default MDB Container", "MESSAGE");

        // load ejb-jar.xml
        String ejbJarXml = XmlUtil.loadEjbJarXml(null, moduleFile);
        assertNotNull(ejbJarXml);
        EjbJar ejbJar = XmlUtil.unmarshal(EjbJar.class, ejbJarXml);

        // load openejb-jar.xml
        String openejbJarXml = XmlUtil.loadOpenejbJarXml(null, moduleFile);
        OpenejbJar openejbJar = XmlUtil.unmarshal(OpenejbJar.class, openejbJarXml);

        // create the module object
        ClassLoader classLoader = new URLClassLoader(new URL[] {file.toURL()}, getClass().getClassLoader());
        EjbModule ejbModule = new EjbModule(classLoader, moduleFile.getName(), ejbJar, openejbJar);
        // configure the application
        EjbJarInfo ejbJarInfo = openEjbSystem.configureApplication(ejbModule);
        openEjbSystem.createEjbJar(ejbJarInfo, classLoader);
    }
View Full Code Here

        }

        Properties props = null;
        Container container = containerSystem.getContainer(containerId);
        if (container.getContainerType() == ContainerType.MESSAGE_DRIVEN) {
            OpenEjbSystem openEjbSystem = null;
            AbstractNameQuery absQuery = new AbstractNameQuery(
                    OpenEjbSystem.class.getName());
            Set<AbstractName> systemGBeans = kernel.listGBeans(absQuery);
            for (AbstractName absName : systemGBeans) {
                openEjbSystem = kernel.getProxyManager()
                        .createProxy(absName, OpenEjbSystem.class);
                props = openEjbSystem.getProperties();
                if (props == null) {
                    props = new Properties();
                }
                props.put(containerId + "." + propertyKey, propertyValue);
                openEjbSystem.setProperties(props);
                getGBeanDataFromConfiguration(absName).setAttribute("properties", props);

            }
        } else {
            AbstractNameQuery absQuery = new AbstractNameQuery(
View Full Code Here

        }

        Properties props = null;
        Container container = containerSystem.getContainer(containerId);
        if (container.getContainerType() == ContainerType.MESSAGE_DRIVEN) {
            OpenEjbSystem openEjbSystem = null;
            AbstractNameQuery absQuery = new AbstractNameQuery(
                    OpenEjbSystem.class.getName());
            Set<AbstractName> systemGBeans = kernel.listGBeans(absQuery);
            for (AbstractName absName : systemGBeans) {
                openEjbSystem = kernel.getProxyManager()
                        .createProxy(absName, OpenEjbSystem.class);
                props = openEjbSystem.getProperties();
                if (props == null) {
                    props = new Properties();
                }
                props.put(containerId + "." + propertyKey, propertyValue);
                openEjbSystem.setProperties(props);
                getGBeanDataFromConfiguration(absName).setAttribute("properties", props);

            }
        } else {
            AbstractNameQuery absQuery = new AbstractNameQuery(
View Full Code Here

TOP

Related Classes of org.apache.geronimo.openejb.OpenEjbSystem

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.