Package org.apache.geronimo.kernel

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


            kernel.startGBean(j2eeServerObjectName);
            assertRunning(kernel, j2eeServerObjectName);

            // load the configuration
            ObjectName objectName = ObjectName.getInstance("test:configuration=test-ejb-jar");
            kernel.loadGBean(objectName, config);
            config.setAttribute("baseURL", unpackedDir.toURL());

            // start the configuration
            kernel.startRecursiveGBean(objectName);
            assertRunning(kernel, objectName);
View Full Code Here


        try {
            assertEquals(kernel, KernelRegistry.getKernel("test.kernel"));
            ObjectName proxyFactoryName = null;//referenceFactory.createAdminObjectObjectName("testAdminObject");
            GBeanData gbean = new GBeanData(proxyFactoryName, getGbeanInfo());
            gbean.setAttribute("Content", proxy);
            kernel.loadGBean(gbean, Class.forName(gbean.getGBeanInfo().getClassName()).getClassLoader());
            kernel.startGBean(proxyFactoryName);
            Object o = context.lookup("env/resourceenvref");
            assertEquals(proxy, o);
        } finally {
            kernel.shutdown();
View Full Code Here

                System.exit(1);
                throw new AssertionError();
            }

            // load this configuration into the kernel
            kernel.loadGBean(configuration, classLoader);
            kernel.startGBean(configName);

            // add our shutdown hook
            Runtime.getRuntime().addShutdownHook(new Thread("Geronimo shutdown thread") {
                public void run() {
View Full Code Here

            // add the jmx bridge
            ObjectName mbeanServerKernelBridgeName = new ObjectName("geronimo.boot:role=MBeanServerKernelBridge");
            GBeanData mbeanServerKernelBridge = new GBeanData(mbeanServerKernelBridgeName, MBeanServerKernelBridge.GBEAN_INFO);
            mbeanServerKernelBridge.setAttribute("mbeanServerId", mbeanServerId);
            kernel.loadGBean(mbeanServerKernelBridge, classLoader);
            kernel.startGBean(mbeanServerKernelBridgeName);

            // start this configuration
            kernel.invoke(configName, "loadGBeans", new Object[]{null}, new String[]{ManageableAttributeStore.class.getName()});
            kernel.invoke(configName, "startRecursiveGBeans");
View Full Code Here

        kernel.boot();
        ObjectName objectName = new ObjectName("speed:type=MockGBean");
        GBeanData mockGBean = new GBeanData(objectName, MockGBean.getGBeanInfo());
        mockGBean.setAttribute("Name", "bar");
        mockGBean.setAttribute("FinalInt", new Integer(57));
        kernel.loadGBean(mockGBean, Speed.class.getClassLoader());
        kernel.startGBean(objectName);

        // reflect proxy
//        ProxyFactory vmProxyFactory = new VMProxyFactory(MyInterface.class);
//        ProxyMethodInterceptor vmMethodInterceptor = vmProxyFactory.getMethodInterceptor();
View Full Code Here

        kernel.boot();
        ObjectName objectName = new ObjectName("speed:type=MockGBean");
        GBeanData mockGBean = new GBeanData(objectName, MockGBean.getGBeanInfo());
        mockGBean.setAttribute("Name", "bar");
        mockGBean.setAttribute("FinalInt", new Integer(57));
        kernel.loadGBean(mockGBean, Speed.class.getClassLoader());
        kernel.startGBean(objectName);

        // reflect proxy
//        ProxyFactory vmProxyFactory = new VMProxyFactory(MyInterface.class);
//        ProxyMethodInterceptor vmMethodInterceptor = vmProxyFactory.getMethodInterceptor();
View Full Code Here

        // build a basic kernel without a configuration-store, our configuration store is
        Kernel kernel = KernelFactory.newInstance().createKernel(getKernelName());
        kernel.boot();

        kernel.loadGBean(configuration, this.getClass().getClassLoader());
        kernel.startGBean(configName);
        kernel.invoke(configName, "loadGBeans", new Object[] {null}, new String[] {ManageableAttributeStore.class.getName()});
        kernel.invoke(configName, "startRecursiveGBeans");

        // load the rest of the configuration listed on the command line
View Full Code Here

    public void testBuildConfiguration() throws Exception {
        Kernel kernel = KernelFactory.newInstance().createKernel("foo");
        kernel.boot();

        GBeanData store = new GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), MockConfigStore.GBEAN_INFO);
        kernel.loadGBean(store, this.getClass().getClassLoader());
        kernel.startGBean(store.getName());

        ObjectName configurationManagerName = new ObjectName(":j2eeType=ConfigurationManager,name=Basic");
        GBeanData configurationManagerData = new GBeanData(configurationManagerName, ConfigurationManagerImpl.GBEAN_INFO);
        configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
View Full Code Here

        kernel.startGBean(store.getName());

        ObjectName configurationManagerName = new ObjectName(":j2eeType=ConfigurationManager,name=Basic");
        GBeanData configurationManagerData = new GBeanData(configurationManagerName, ConfigurationManagerImpl.GBEAN_INFO);
        configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
        kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
        kernel.startGBean(configurationManagerName);

        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, ejbConfigBuilder, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, kernel);

        File tempDir = null;
View Full Code Here

            configurationManager.start(defaultParentId[0]);

            ObjectName serverInfoObjectName = ObjectName.getInstance(j2eeContext.getJ2eeDomainName() + ":name=ServerInfo");
            GBeanData serverInfoGBean = new GBeanData(serverInfoObjectName, BasicServerInfo.GBEAN_INFO);
            serverInfoGBean.setAttribute("baseDirectory", ".");
            kernel.loadGBean(serverInfoGBean, cl);
            kernel.startGBean(serverInfoObjectName);
            assertRunning(kernel, serverInfoObjectName);

            ObjectName j2eeServerObjectName = NameFactory.getServerName(null, null, j2eeContext);
            GBeanData j2eeServerGBean = new GBeanData(j2eeServerObjectName, J2EEServerImpl.GBEAN_INFO);
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.