1 23 24 package com.sun.enterprise.management.monitor; 25 import com.sun.appserv.management.config.LoadBalancerConfig; 26 import java.util.Map ; 27 28 import javax.management.ObjectName ; 29 30 import static com.sun.appserv.management.base.XTypes.*; 31 import com.sun.appserv.management.monitor.LoadBalancerServerMonitor; 32 import com.sun.enterprise.management.monitor.stats.LoadBalancerServerStatsImpl; 33 import com.sun.enterprise.management.monitor.stats.CustomMonitoringStatsImplBase; 34 import com.sun.appserv.management.monitor.statistics.LoadBalancerServerStats; 35 import com.sun.appserv.management.j2ee.statistics.StatsImpl; 36 37 public final class LoadBalancerServerMonitorImpl extends CustomMonitoringStatsImplBase { 38 39 public LoadBalancerServerMonitorImpl() { 40 super(LoadBalancerServerMonitor.J2EE_TYPE); 41 } 42 43 protected final Class getStatsInterface() { 44 return LoadBalancerServerStats.class; 45 } 46 47 public LoadBalancerServerStats getLoadBalancerServerStats() { 48 return (LoadBalancerServerStats) getStats(); 49 } 50 51 55 public Map <String ,ObjectName > getLoadBalancerApplicationMonitorObjectNameMap() { 56 return (getContaineeObjectNameMap(LOAD_BALANCER_APPLICATION_MONITOR)); 57 } 58 59 protected StatsImpl createStatsImpl() { 60 String instanceName = getName(); 61 String lbName = getObjectName().getKeyProperty(LOAD_BALANCER_MONITOR); 62 String clusterName = getObjectName().getKeyProperty(LOAD_BALANCER_CLUSTER_MONITOR); 63 Map <String , LoadBalancerConfig> loadBalancerConfigMap = 64 getDomainRoot().getDomainConfig().getLoadBalancerConfigMap(); 65 LoadBalancerConfig loadBalancerConfig = loadBalancerConfigMap.get(lbName); 66 String lbConfigName = loadBalancerConfig.getLbConfigName(); 67 return new StatsImpl(getStatisticsFromImpl(new LoadBalancerServerStatsImpl(lbName,lbConfigName,clusterName,instanceName))); 68 } 69 } 70 | Popular Tags |