Here you can find the source of isServerStarted(MBeanServerConnection server)
Parameter | Description |
---|---|
server | given MBeanServerConnection |
Parameter | Description |
---|---|
Exception | A few types of exception can be thrown. |
public static boolean isServerStarted(MBeanServerConnection server) throws Exception
//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(); } }