Package org.apache.geronimo.kernel

Examples of org.apache.geronimo.kernel.Kernel.loadGBean()


        }

        GBeanMBean manager;
        try {
            ObjectName serverName = new ObjectName("geronimo.deployment:role=DeploymentServer");
            kernel.loadGBean(serverName, server);
            kernel.startGBean(serverName);

            ObjectName managerName = new ObjectName("geronimo.deployment:role=DeploymentManager");
            manager = new GBeanMBean(DeploymentManagerImpl.GBEAN_INFO);
            manager.setReferencePatterns("Server", Collections.singleton(serverName));
View Full Code Here


            manager.setReferencePatterns("Server", Collections.singleton(serverName));
            manager.setReferencePatterns("Configurers", Collections.singleton(new ObjectName("geronimo.deployment:role=Configurer,*")));

            // @todo for now lets hard code the deployers to use - ultimately this should use a predefined Configuration

            kernel.loadGBean(managerName, manager);
            kernel.startGBean(managerName);

        } catch (Exception e) {
            // this should not happen - we own this kernel!
            throw (IllegalStateException) new IllegalStateException("Unable to load DeploymentManager").initCause(e);
View Full Code Here

            RAR_1_5ConfigBuilder configBuilder = new RAR_1_5ConfigBuilder(kernel, null, new ObjectName("geronimo.server:type=ConnectionTracker"));
            DeploymentContext context =  new MockDeploymentContext(kernel);
            configBuilder.addConnectorGBeans(context, connectorDocument, geronimoConnectorDocument.getConnector(), this.getClass().getClassLoader());
            for (Iterator iterator = gbeans.entrySet().iterator(); iterator.hasNext();) {
                Map.Entry entry = (Map.Entry) iterator.next();
                kernel.loadGBean((ObjectName)entry.getKey(), (GBeanMBean)entry.getValue());
            }
            for (Iterator iterator = gbeans.keySet().iterator(); iterator.hasNext();) {
                ObjectName name = (ObjectName) iterator.next();
                kernel.startRecursiveGBean(name);
            }
View Full Code Here

        try {
            assertEquals(kernel, Kernel.getKernel("test.kernel"));
            ObjectName proxyFactoryName = ObjectName.getInstance(JMXReferenceFactory.BASE_ADMIN_OBJECT_NAME + "testAdminObject");
            GBeanMBean gbean = new GBeanMBean(getGbeanInfo());
            gbean.setAttribute("Content", proxy);
            kernel.loadGBean(proxyFactoryName, gbean);
            kernel.startGBean(proxyFactoryName);
            Object o = roc.lookup("env/resourceenvref");
            assertEquals(proxy, o);
        } finally {
            kernel.shutdown();
View Full Code Here

            attribute.setValue(valueThatCausesException);

            final Kernel kernel = new Kernel("test.kernel", "test");
            try {
                kernel.boot();
                kernel.loadGBean(name, gmbean);
                attribute.online();
                fail("Setter upon call with " + valueThatCausesException + " should have thrown exception");
            } catch (/* IllegalArgument */Exception expected) {
            } finally {
                // @todo possible BUG: gmbean holds information on being online
View Full Code Here

            attribute.setValue(valueThatCausesError);

            final Kernel kernel = new Kernel("test.kernel", "test");
            try {
                kernel.boot();
                kernel.loadGBean(name, gmbean);
                attribute.online();
                fail("Setter upon call with " + valueThatCausesError + " should have thrown error");
            } catch (Error expected) {
            } finally {
                // @todo possible BUG: see the above finally block
View Full Code Here

            attribute.setValue(valueThatCausesThrowable);

            final Kernel kernel = new Kernel("test.kernel", "test");
            try {
                kernel.boot();
                kernel.loadGBean(name, gmbean);
                attribute.online();
                fail("Setter upon call with " + valueThatCausesThrowable + " should have thrown throwable");
            } catch (Throwable expected) {
            } finally {
                kernel.shutdown();
View Full Code Here

            final ObjectName name = new ObjectName("test:name=MyMockGBean");

            final Kernel kernel = new Kernel("test.kernel", "test");
            try {
                kernel.boot();
                kernel.loadGBean(name, gmbean);
                kernel.startGBean(name);

                attribute.getValue();
                fail("This attribute is not readable; exception expected");
            } catch (/* IllegalArgument */Exception expected) {
View Full Code Here

            RAR_1_0ConfigBuilder configBuilder = new RAR_1_0ConfigBuilder(kernel, null, new ObjectName("geronimo.server:type=ConnectionTracker"));
            DeploymentContext context =  new MockDeploymentContext(kernel);
            configBuilder.addConnectorGBeans(context, connectorDocument, geronimoConnectorDocument.getConnector(), this.getClass().getClassLoader());
            for (Iterator iterator = gbeans.entrySet().iterator(); iterator.hasNext();) {
                Map.Entry entry = (Map.Entry) iterator.next();
                kernel.loadGBean((ObjectName)entry.getKey(), (GBeanMBean)entry.getValue());
            }
            for (Iterator iterator = gbeans.keySet().iterator(); iterator.hasNext();) {
                ObjectName name = (ObjectName) iterator.next();
                kernel.startRecursiveGBean(name);
            }
View Full Code Here

            final ObjectName name = new ObjectName("test:name=MyMockDynamicGBean");

            final Kernel kernel = new Kernel("test.kernel", "test");
            try {
                kernel.boot();
                kernel.loadGBean(name, dynamicGmbean);
                kernel.startGBean(name);

                final Integer zero = new Integer(0);
                assertEquals(zero, attribute.getValue());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.