Examples of GBeanMBean


Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

    public void setUp() throws Exception {
        kernel = new Kernel("test.kernel", "simple.geronimo.test");
        kernel.boot();

        GBeanMBean gbean;

        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        // Create all the parts
        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter", cl);
        subsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter");
        kernel.loadGBean(subsystemRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader", cl);
        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:0"));
        gbean.setReferencePatterns("Router", Collections.singleton(subsystemRouter));
        asyncTransport = new ObjectName("geronimo.remoting:transport=async");
        kernel.loadGBean(asyncTransport, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter", cl);
        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(subsystemRouter));
        jmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter");
        kernel.loadGBean(jmxRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.jmx.MBeanServerStub", cl);
        gbean.setReferencePatterns("Router", Collections.singleton(jmxRouter));
        serverStub = new ObjectName("geronimo.remoting:target=MBeanServerStub");
        kernel.loadGBean(serverStub, gbean);

        kernel.startGBean(subsystemRouter);
        kernel.startGBean(asyncTransport);
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

*/
public class StartupTest  extends TestCase {
    private Kernel kernel;

    public void testLoad() throws Exception {
        GBeanMBean gbean;

        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        // Create all the parts
        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter", cl);
        ObjectName subsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter");
        kernel.loadGBean(subsystemRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader", cl);
        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:3434"));
        gbean.setReferencePatterns("Router", Collections.singleton(subsystemRouter));
        ObjectName asyncTransport = new ObjectName("geronimo.remoting:transport=async");
        kernel.loadGBean(asyncTransport, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter", cl);
        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(subsystemRouter));
        ObjectName jmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter");
        kernel.loadGBean(jmxRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.InterceptorRegistryRouter", cl);
        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(subsystemRouter));
        ObjectName registeryRouter = new ObjectName("geronimo.remoting:router=InterceptorRegistryRouter");
        kernel.loadGBean(registeryRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.jmx.MBeanServerStub", cl);
        gbean.setReferencePatterns("Router", Collections.singleton(jmxRouter));
        ObjectName serverStub = new ObjectName("geronimo.remoting:target=MBeanServerStub");
        kernel.loadGBean(serverStub, gbean);

        // Start all the parts
        kernel.startGBean(subsystemRouter);
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        }
    }

    public void loadGBean(GBeanData gbeanData, ClassLoader classLoader) throws InstanceAlreadyExistsException, InvalidConfigException {
        try {
            GBeanMBean gbean = new GBeanMBean(gbeanData, classLoader);
            mbServer.registerMBean(gbean, gbeanData.getName());
        } catch (JMRuntimeException e) {
            throw new InvalidConfigException("Invalid GBean configuration for " + gbeanData.getName(), unwrapJMException(e));
        } catch (JMException e) {
            throw new InvalidConfigException("Invalid GBean configuration for " + gbeanData.getName(), unwrapJMException(e));
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        try {
            ObjectName objectName = createObjectName(name);
            /*
            springNameToObjectName.put(name, objectName);
            */
            GBeanMBean gbean = createGBean(bean, name);
            if (gbean == null) {
                log.warn("No GBean available for name: " + name + " bean: " + bean);
            }
            else {
                kernel.loadGBean(objectName, gbean);
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        mbServer = MBeanServerFactory.createMBeanServer(domainName);
        mbServer.registerMBean(this, KERNEL);
        dependencyManager = new DependencyManager(mbServer);

        configurationManagerGBean = new GBeanMBean(ConfigurationManagerImpl.GBEAN_INFO);
        configurationManagerGBean.setReferencePatterns("Stores", Collections.singleton(CONFIGURATION_STORE_PATTERN));
        mbServer.registerMBean(configurationManagerGBean, CONFIGURATION_MANAGER_NAME);
        configurationManagerGBean.start();
        configurationManager = (ConfigurationManager) configurationManagerGBean.getTarget();
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

    protected void setUp() throws Exception {
        kernel = new Kernel("test.kernel", "simple.geronimo.test");
        kernel.boot();

        GBeanMBean gbean;

        // Create all the parts

        gbean = new GBeanMBean("org.apache.geronimo.security.jaas.LoginService");
        loginService = new ObjectName("geronimo.security:type=LoginService");
        gbean.setReferencePatterns("Realms", Collections.singleton(new ObjectName("geronimo.security:type=SecurityRealm,*")));
        gbean.setAttribute("reclaimPeriod", new Long(10 * 1000))// todo check other tests to see if ok
        gbean.setAttribute("algorithm", "HmacSHA1");
        gbean.setAttribute("password", "secret");
        kernel.loadGBean(loginService, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.security.bridge.TestRealm");
        testRealm = new ObjectName("geronimo.security:type=SecurityRealm,realm=testrealm");
        gbean.setAttribute("realmName", TestRealm.REALM_NAME);
        gbean.setAttribute("maxLoginModuleAge", new Long(1 * 1000));
        gbean.setAttribute("debug", new Boolean(true));
        kernel.loadGBean(testRealm, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter");
        subsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter");
        kernel.loadGBean(subsystemRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:4242"));
        gbean.setReferencePatterns("Router", Collections.singleton(subsystemRouter));
        asyncTransport = new ObjectName("geronimo.remoting:transport=async");
        kernel.loadGBean(asyncTransport, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter");
        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(subsystemRouter));
        jmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter");
        kernel.loadGBean(jmxRouter, gbean);

        gbean = new GBeanMBean("org.apache.geronimo.security.remoting.jmx.LoginServiceStub");
        gbean.setReferencePatterns("Router", Collections.singleton(jmxRouter));
        serverStub = new ObjectName("geronimo.remoting:target=LoginServiceStub");
        kernel.loadGBean(serverStub, gbean);

        kernel.startGBean(loginService);
        kernel.startGBean(testRealm);
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        tcaName = AxisGeronimoConstants.CONNTECTION_TRACKING_COORDINATOR;
        tcmName = AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME;
    }

    public void doStart() throws Exception {
        GBeanMBean connector;
        GBeanMBean tm;
        GBeanMBean ctc;
        GBeanMBean container;
        container = new GBeanMBean(JettyContainerImpl.GBEAN_INFO);
        connector = new GBeanMBean(HTTPConnector.GBEAN_INFO);
        connector.setAttribute("port", new Integer(AxisGeronimoUtils.AXIS_SERVICE_PORT));
        connector.setReferencePatterns("JettyContainer", containerPatterns);
        start(containerName, container);
        start(connectorName, connector);

        tm = new GBeanMBean(GeronimoTransactionManager.GBEAN_INFO);
        Set patterns = new HashSet();
        patterns.add(ObjectName.getInstance("geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
        tm.setReferencePatterns("ResourceManagers", patterns);
        start(tmName, tm);
        GBeanMBean tcm = new GBeanMBean(TransactionContextManager.GBEAN_INFO);
        tcm.setReferencePattern("TransactionManager", tmName);
        start(tcmName, tcm);
        ctc = new GBeanMBean(ConnectionTrackingCoordinator.GBEAN_INFO);
        start(tcaName, ctc);
    }
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

    public void start() throws Exception {
        jettyService = new JettyServiceWrapper(kernel);
        jettyService.doStart();
        ClassLoader cl = getClass().getClassLoader();
        ClassLoader myCl = new URLClassLoader(new URL[0], cl);
        GBeanMBean gbean = new GBeanMBean(AxisGbean.getGBeanInfo(), myCl);
        gbean.setAttribute("Name", "Test");
        kernel.loadGBean(name, gbean);
        kernel.startGBean(name);
    }
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

                str = str + ":org.apache.geronimo.naming";
            }
            System.setProperty(javax.naming.Context.URL_PKG_PREFIXES, str);
            setUpTransactionManager(kernel);
            setUpTimer(kernel);
            GBeanMBean serverInfoGBean = new GBeanMBean(ServerInfo.GBEAN_INFO);
            serverInfoGBean.setAttribute("baseDirectory", ".");
            AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.J2EE_SERVER_INFO, serverInfoGBean, kernel);
            GBeanMBean j2eeServerGBean = new GBeanMBean(J2EEServerImpl.GBEAN_INFO);
            j2eeServerGBean.setReferencePatterns("ServerInfo", Collections.singleton(AxisGeronimoConstants.J2EE_SERVER_INFO));
            AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.J2EE_SERVER_NAME, j2eeServerGBean, kernel);
                   

            // //load mock resource adapter for mdb
            // setUpResourceAdapter(kernel);
View Full Code Here

Examples of org.apache.geronimo.gbean.jmx.GBeanMBean

        }
    }

    private void setUpTransactionManager(Kernel kernel) throws AxisFault {
        try {
            GBeanMBean tmGBean = new GBeanMBean(GeronimoTransactionManager.GBEAN_INFO);
            Set rmpatterns = new HashSet();
            rmpatterns.add(ObjectName.getInstance("geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
            tmGBean.setAttribute("defaultTransactionTimeoutSeconds", new Integer(10));
            tmGBean.setReferencePatterns("ResourceManagers", rmpatterns);
            AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.TRANSACTION_MANAGER_NAME, tmGBean, kernel);
            GBeanMBean tcmGBean = new GBeanMBean(TransactionContextManager.GBEAN_INFO);
            tcmGBean.setReferencePattern("TransactionManager", AxisGeronimoConstants.TRANSACTION_MANAGER_NAME);
            AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.TRANSACTION_CONTEXT_MANAGER_NAME, tcmGBean, kernel);
            GBeanMBean trackedConnectionAssociator = new GBeanMBean(ConnectionTrackingCoordinator.GBEAN_INFO);
            AxisGeronimoUtils.startGBeanOnlyIfNotStarted(AxisGeronimoConstants.TRACKED_CONNECTION_ASSOCIATOR_NAME, trackedConnectionAssociator, kernel);
        } catch (Exception e) {
            throw AxisFault.makeFault(e);
        }
    }
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.