Package com.sun.sgs.management

Examples of com.sun.sgs.management.ChannelServiceMXBean


        cons.setProfileLevel(ProfileLevel.MAX);
       
        ObjectName name = new ObjectName(ChannelServiceMXBean.MXBEAN_NAME);
       
        // Ensure the object was registered at startup
        ChannelServiceMXBean bean = (ChannelServiceMXBean)
            profileCollector.getRegisteredMBean(
                      ChannelServiceMXBean.MXBEAN_NAME);
        assertNotNull(bean);
       
        // Get individual fields
        long create = (Long) mbsc.getAttribute(name, "CreateChannelCalls");
        long get = (Long) mbsc.getAttribute(name,  "GetChannelCalls");
       
        // Create the proxy for the object
        ChannelServiceMXBean proxy =
            JMX.newMXBeanProxy(mbsc, name, ChannelServiceMXBean.class);
       
        assertTrue(create <= proxy.getCreateChannelCalls());
        assertTrue(get <= proxy.getGetChannelCalls());
       
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() {
                    try {
                        serverNode.getChannelService().getChannel("foo");
                    } catch (NameNotBoundException nnb) {
                        System.out.println("Got expected exception " + nnb);
                    }
                }
            }, taskOwner);
      
        assertTrue(get < proxy.getGetChannelCalls());
        assertTrue(get < bean.getGetChannelCalls());
    }
View Full Code Here

TOP

Related Classes of com.sun.sgs.management.ChannelServiceMXBean

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.