Package org.jboss.system

Examples of org.jboss.system.ServiceControllerMBean


         assertEquals(1, test.createOrder);
         assertEquals(2, test.startOrder);
         assertEquals(0, test.stopOrder);
         assertEquals(0, test.destroyOrder);

         ServiceControllerMBean controller = getController();

         controller.stop(name);
         assertServiceStopped(name);
         assertEquals(1, test.createOrder);
         assertEquals(2, test.startOrder);
         assertEquals(3, test.stopOrder);
         assertEquals(0, test.destroyOrder);

         controller.destroy(name);
         assertServiceDestroyed(name);
         assertEquals(1, test.createOrder);
         assertEquals(2, test.startOrder);
         assertEquals(3, test.stopOrder);
         assertEquals(4, test.destroyOrder);

         controller.create(name);
         assertServiceCreated(name);
         assertEquals(5, test.createOrder);
         assertEquals(2, test.startOrder);
         assertEquals(3, test.stopOrder);
         assertEquals(4, test.destroyOrder);

         controller.start(name);
         assertServiceRunning(name);
         assertEquals(5, test.createOrder);
         assertEquals(6, test.startOrder);
         assertEquals(3, test.stopOrder);
         assertEquals(4, test.destroyOrder);
View Full Code Here


         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(0, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         ServiceControllerMBean controller = getController();
        
         controller.stop(NAME_ONE);
         assertServiceStopped(NAME_ONE);
         assertServiceRunning(NAME_TWO);
         assertEquals(2, test1.createOrder);
         assertEquals(4, test1.startOrder);
         assertEquals(5, test1.stopOrder);
         assertEquals(0, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(0, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         controller.destroy(NAME_ONE);
         assertServiceDestroyed(NAME_ONE);
         assertServiceRunning(NAME_TWO);
         assertEquals(2, test1.createOrder);
         assertEquals(4, test1.startOrder);
         assertEquals(5, test1.stopOrder);
         assertEquals(6, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(0, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         controller.create(NAME_ONE);
         assertServiceCreated(NAME_ONE);
         assertServiceRunning(NAME_TWO);
         assertEquals(7, test1.createOrder);
         assertEquals(4, test1.startOrder);
         assertEquals(5, test1.stopOrder);
         assertEquals(6, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(0, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         controller.start(NAME_ONE);
         assertServiceRunning(NAME_ONE);
         assertServiceRunning(NAME_TWO);
         assertEquals(7, test1.createOrder);
         assertEquals(8, test1.startOrder);
         assertEquals(5, test1.stopOrder);
         assertEquals(6, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(0, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         controller.stop(NAME_TWO);
         assertServiceStopped(NAME_ONE);
         assertServiceStopped(NAME_TWO);
         assertEquals(7, test1.createOrder);
         assertEquals(8, test1.startOrder);
         assertEquals(9, test1.stopOrder);
         assertEquals(6, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(10, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         controller.destroy(NAME_TWO);
         assertServiceDestroyed(NAME_ONE);
         assertServiceDestroyed(NAME_TWO);
         assertEquals(7, test1.createOrder);
         assertEquals(8, test1.startOrder);
         assertEquals(9, test1.stopOrder);
         assertEquals(11, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(10, test2.stopOrder);
         assertEquals(12, test2.destroyOrder);
        
         controller.create(NAME_TWO);
         assertServiceCreated(NAME_ONE);
         assertServiceCreated(NAME_TWO);
         assertEquals(14, test1.createOrder);
         assertEquals(8, test1.startOrder);
         assertEquals(9, test1.stopOrder);
         assertEquals(11, test1.destroyOrder);
         assertEquals(13, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(10, test2.stopOrder);
         assertEquals(12, test2.destroyOrder);
        
         controller.start(NAME_TWO);
         assertServiceRunning(NAME_ONE);
         assertServiceRunning(NAME_TWO);
         assertEquals(14, test1.createOrder);
         assertEquals(16, test1.startOrder);
         assertEquals(9, test1.stopOrder);
View Full Code Here

         assertEquals(1, test.createOrder);
         assertEquals(2, test.startOrder);
         assertEquals(0, test.stopOrder);
         assertEquals(0, test.destroyOrder);

         ServiceControllerMBean controller = getController();

         controller.stop(name);
         assertServiceStopped(name);
         assertEquals(1, test.createOrder);
         assertEquals(2, test.startOrder);
         assertEquals(3, test.stopOrder);
         assertEquals(0, test.destroyOrder);

         controller.destroy(name);
         assertServiceDestroyed(name);
         assertEquals(1, test.createOrder);
         assertEquals(2, test.startOrder);
         assertEquals(3, test.stopOrder);
         assertEquals(4, test.destroyOrder);

         controller.create(name);
         assertServiceCreated(name);
         assertEquals(5, test.createOrder);
         assertEquals(2, test.startOrder);
         assertEquals(3, test.stopOrder);
         assertEquals(4, test.destroyOrder);

         controller.start(name);
         assertServiceRunning(name);
         assertEquals(5, test.createOrder);
         assertEquals(6, test.startOrder);
         assertEquals(3, test.stopOrder);
         assertEquals(4, test.destroyOrder);
View Full Code Here

         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(0, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         ServiceControllerMBean controller = getController();
        
         controller.stop(NAME_ONE);
         assertServiceStopped(NAME_ONE);
         assertServiceRunning(NAME_TWO);
         assertEquals(2, test1.createOrder);
         assertEquals(4, test1.startOrder);
         assertEquals(5, test1.stopOrder);
         assertEquals(0, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(0, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         controller.destroy(NAME_ONE);
         assertServiceDestroyed(NAME_ONE);
         assertServiceRunning(NAME_TWO);
         assertEquals(2, test1.createOrder);
         assertEquals(4, test1.startOrder);
         assertEquals(5, test1.stopOrder);
         assertEquals(6, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(0, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         controller.create(NAME_ONE);
         assertServiceCreated(NAME_ONE);
         assertServiceRunning(NAME_TWO);
         assertEquals(7, test1.createOrder);
         assertEquals(4, test1.startOrder);
         assertEquals(5, test1.stopOrder);
         assertEquals(6, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(0, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         controller.start(NAME_ONE);
         assertServiceRunning(NAME_ONE);
         assertServiceRunning(NAME_TWO);
         assertEquals(7, test1.createOrder);
         assertEquals(8, test1.startOrder);
         assertEquals(5, test1.stopOrder);
         assertEquals(6, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(0, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         controller.stop(NAME_TWO);
         assertServiceStopped(NAME_ONE);
         assertServiceStopped(NAME_TWO);
         assertEquals(7, test1.createOrder);
         assertEquals(8, test1.startOrder);
         assertEquals(9, test1.stopOrder);
         assertEquals(6, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(10, test2.stopOrder);
         assertEquals(0, test2.destroyOrder);
        
         controller.destroy(NAME_TWO);
         assertServiceDestroyed(NAME_ONE);
         assertServiceDestroyed(NAME_TWO);
         assertEquals(7, test1.createOrder);
         assertEquals(8, test1.startOrder);
         assertEquals(9, test1.stopOrder);
         assertEquals(11, test1.destroyOrder);
         assertEquals(1, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(10, test2.stopOrder);
         assertEquals(12, test2.destroyOrder);
        
         controller.create(NAME_TWO);
         assertServiceCreated(NAME_ONE);
         assertServiceCreated(NAME_TWO);
         assertEquals(14, test1.createOrder);
         assertEquals(8, test1.startOrder);
         assertEquals(9, test1.stopOrder);
         assertEquals(11, test1.destroyOrder);
         assertEquals(13, test2.createOrder);
         assertEquals(3, test2.startOrder);
         assertEquals(10, test2.stopOrder);
         assertEquals(12, test2.destroyOrder);
        
         controller.start(NAME_TWO);
         assertServiceRunning(NAME_ONE);
         assertServiceRunning(NAME_TWO);
         assertEquals(14, test1.createOrder);
         assertEquals(16, test1.startOrder);
         assertEquals(9, test1.stopOrder);
View Full Code Here

    protected void handleJMXRegistration(boolean register) throws Exception
    {
        MBeanServer server = MBeanServerLocator.locateJBoss();
        if (server == null)
            throw new IllegalArgumentException("Not running in JBoss app. server [currently only supporting]");
        ServiceControllerMBean serviceController = (ServiceControllerMBean)MBeanProxyExt.create(ServiceControllerMBean.class, ServiceControllerMBean.OBJECT_NAME);
        if (register)
        {
            server.registerMBean(this, objectName);
            // we want it to be installed
            serviceController.start(objectName);
        }
        else if (objectName != null)
        {
            // destroy it
            serviceController.destroy(objectName);
            serviceController.remove(objectName);
        }
    }
View Full Code Here

    protected void handleJMXRegistration(boolean register) throws Exception
    {
        MBeanServer server = MBeanServerLocator.locateJBoss();
        if (server == null)
            throw new IllegalArgumentException("Not running in JBoss app. server [currently only supporting]");
        ServiceControllerMBean serviceController = (ServiceControllerMBean)MBeanProxyExt.create(ServiceControllerMBean.class, ServiceControllerMBean.OBJECT_NAME);
        if (register)
        {
            server.registerMBean(this, objectName);
            // we want it to be installed
            serviceController.start(objectName);
        }
        else if (objectName != null)
        {
            // destroy it
            serviceController.destroy(objectName);
            serviceController.remove(objectName);
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.system.ServiceControllerMBean

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.