1 4 package com.tc.admin; 5 6 import com.tc.management.beans.L2MBeanNames; 7 8 import javax.management.ObjectName ; 9 10 public class ServerHelper extends BaseHelper { 11 private static ServerHelper m_helper = new ServerHelper(); 12 13 public static ServerHelper getHelper() { 14 return m_helper; 15 } 16 17 public ObjectName getServerInfoMBean(ConnectionContext cc) throws Exception { 18 return cc.queryName(L2MBeanNames.TC_SERVER_INFO.getCanonicalName()); 19 } 20 21 public boolean isActive(ConnectionContext cc) throws Exception { 22 ObjectName infoMBean = getServerInfoMBean(cc); 23 24 return infoMBean != null && cc.getBooleanAttribute(infoMBean, "Active"); 25 } 26 27 public boolean isStarted(ConnectionContext cc) throws Exception { 28 ObjectName infoMBean = getServerInfoMBean(cc); 29 30 return infoMBean != null && cc.getBooleanAttribute(infoMBean, "Started"); 31 } 32 } 33 | Popular Tags |