Package com.sun.sgs.management

Examples of com.sun.sgs.management.TaskServiceMXBean


        cons.setProfileLevel(ProfileLevel.MAX);
       
        ObjectName name = new ObjectName(TaskServiceMXBean.MXBEAN_NAME);
       
        // Ensure the object was registered at startup
        TaskServiceMXBean bean = (TaskServiceMXBean)
            profileCollector.getRegisteredMBean(TaskServiceMXBean.MXBEAN_NAME);
        assertNotNull(bean);
       
        // Get individual fields
        long delayed =
                (Long) mbsc.getAttribute(name, "ScheduleDelayedTaskCalls");
        long nondurable =
                (Long) mbsc.getAttribute(name, "ScheduleNonDurableTaskCalls");
        long nondurableDelayed =
                (Long) mbsc.getAttribute(name,
                                         "ScheduleNonDurableTaskDelayedCalls");
        long periodic =
                (Long) mbsc.getAttribute(name, "SchedulePeriodicTaskCalls");
        long task = (Long) mbsc.getAttribute(name, "ScheduleTaskCalls");
       
        // Create the proxy for the object
        TaskServiceMXBean proxy =
            JMX.newMXBeanProxy(mbsc, name, TaskServiceMXBean.class);
       
        assertTrue(delayed <= proxy.getScheduleDelayedTaskCalls());
        assertTrue(nondurable <= proxy.getScheduleNonDurableTaskCalls());
        assertTrue(nondurableDelayed <=
                proxy.getScheduleNonDurableTaskDelayedCalls());
        assertTrue(periodic <= proxy.getSchedulePeriodicTaskCalls());
        assertTrue(task <= proxy.getScheduleTaskCalls());
       
        // Test an API
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
                public void run() {
                    serverNode.getTaskService().scheduleNonDurableTask(
                        new TestAbstractKernelRunnable() {
                            public void run() { }},
                        false);
                }
            }, taskOwner);
       
        assertTrue(nondurable < proxy.getScheduleNonDurableTaskCalls());
        assertTrue(nondurable < bean.getScheduleNonDurableTaskCalls());
    }
View Full Code Here

TOP

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

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.