Java MBean isServerStarted(MBeanServerConnection server)

Here you can find the source of isServerStarted(MBeanServerConnection server)

Description

Checks if Server is up using given MBean server connection.

License

Open Source License

Parameter

Parameter Description
server given MBeanServerConnection

Exception

Parameter Description
Exception A few types of exception can be thrown.

Return

true if server is up, false otherwise

Declaration

public static boolean isServerStarted(MBeanServerConnection server) throws Exception 

Method Source Code

//package com.java2s;

import javax.management.MBeanServerConnection;
import javax.management.ObjectName;

public class Main {
    /**//from   w ww. j a v a2 s.  co m
     * Checks if Server is up using given MBean server connection.
     * 
     * @param server given {@link MBeanServerConnection}
     * 
     * @return true if server is up, false otherwise
     * 
     * @throws Exception A few types of exception can be thrown.
     */
    public static boolean isServerStarted(MBeanServerConnection server) throws Exception {
        ObjectName serverMBeanName = new ObjectName("jboss.system:type=Server");
        return ((Boolean) server.getAttribute(serverMBeanName, "Started")).booleanValue();
    }
}

Related

  1. infoEquals(MBeanInfo one, MBeanInfo two)
  2. invoke(Logger logger, MBeanServer mbeanServer, ObjectName mbeanName, String methodName, Object... arguments)
  3. invoke(MBeanServer mbs, ObjectName name, String operationName, Object params[], String signature[])
  4. invokeStopOperation(ObjectName name, MBeanServer server)
  5. isRegistered(MBeanServer mbs, ObjectName objectName)
  6. listMBeans(MBeanServerConnection mbsc, String objectNameStr)
  7. makeMBeanName(@Nonnull final String domain, @Nonnull final String type, @Nonnull final String channelName)
  8. makeSignatureString(MBeanParameterInfo[] info)
  9. matchType(MBeanNotificationInfo aInfo, String aMatch)