1 23 24 29 30 package com.sun.enterprise.tools.admingui.util; 31 32 import java.util.*; 33 34 import javax.management.remote.JMXConnector ; 35 36 import com.sun.appserv.management.DomainRoot; 37 import com.sun.appserv.management.base.QueryMgr; 38 import com.sun.appserv.management.base.UploadDownloadMgr; 39 import com.sun.appserv.management.config.DomainConfig; 40 import com.sun.appserv.management.client.ProxyFactory; 41 import com.sun.appserv.management.j2ee.J2EEDomain; 42 import com.sun.appserv.management.monitor.MonitoringRoot; 43 44 public class AMXUtil { 45 46 private static ProxyFactory amxProxyFactory = null; 47 private static DomainRoot domainRoot = null; 48 private static DomainConfig domainConfig = null; 49 private static J2EEDomain j2eeDomain = null; 50 private static MonitoringRoot monitoringRoot = null; 51 private static QueryMgr queryMgr = null; 52 private static UploadDownloadMgr uploadDownloadMgr = null; 53 54 private AMXUtil() {} 56 public static DomainConfig getDomainConfig() { 57 return domainConfig == null ? getDomainRoot().getDomainConfig() : domainConfig; 58 } 59 60 public static J2EEDomain getJ2EEDomain() { 61 return j2eeDomain == null ? getDomainRoot().getJ2EEDomain() : j2eeDomain; 62 } 63 64 public static MonitoringRoot getMonitoringRoot() { 65 return monitoringRoot == null ? getDomainRoot().getMonitoringRoot() : monitoringRoot; 66 } 67 68 public static DomainRoot getDomainRoot() { 69 return domainRoot == null ? getAMXProxyFactory().getDomainRoot() : domainRoot; 70 } 71 72 public static QueryMgr getQueryMgr() { 73 return queryMgr == null ? getDomainRoot().getQueryMgr() : queryMgr; 74 } 75 76 public static UploadDownloadMgr getUploadDownloadMgr() { 77 return uploadDownloadMgr == null ? getDomainRoot().getUploadDownloadMgr() : uploadDownloadMgr; 78 } 79 80 public static ProxyFactory getAMXProxyFactory() { 81 return amxProxyFactory == null ? 82 ProxyFactory.getInstance(MBeanUtil.getMBeanServer()) : amxProxyFactory; 83 } 84 85 } 86 | Popular Tags |