1 23 24 29 30 31 package com.sun.enterprise.management.config; 32 33 import java.util.Set ; 34 import java.util.Map ; 35 import java.util.HashMap ; 36 import java.util.Iterator ; 37 import java.util.Collections ; 38 39 import javax.management.ObjectName ; 40 import com.sun.enterprise.management.config.AMXConfigImplBase; 41 import com.sun.enterprise.management.support.Delegate; 42 43 import com.sun.appserv.management.config.ClusterConfig; 44 import com.sun.appserv.management.base.XTypes; 45 import com.sun.appserv.management.base.Util; 46 47 import com.sun.enterprise.management.support.AMXAttributeNameMapper; 48 49 52 public final class ClusterConfigImpl extends AMXConfigImplBase 53 implements ConfigFactoryCallback 55 { 56 public 57 ClusterConfigImpl( final Delegate delegate ) 58 { 59 super( delegate ); 60 } 61 62 private ClusterConfig 63 self() 64 { 65 return (ClusterConfig)getSelf(); 66 } 67 68 protected void 69 addCustomMappings( final AMXAttributeNameMapper mapper ) 70 { 71 super.addCustomMappings( mapper ); 72 mapper.matchName( "ReferencedConfigName", "config-ref" ); 73 } 74 75 76 77 public Map <String ,ObjectName > 78 getClusteredServerConfigObjectNameMap() 79 { 80 final Map <String ,ObjectName > serverRefConfigMap = 81 Util.toObjectNames( self().getServerRefConfigMap() ); 82 if ( serverRefConfigMap.isEmpty() ) 83 { 84 return new HashMap <String ,ObjectName >(); 85 } 86 87 final Set <ObjectName > allClusteredServerConfigObjectNames = 88 getQueryMgr().queryJ2EETypeObjectNameSet( XTypes.CLUSTERED_SERVER_CONFIG ); 89 final Map <String ,ObjectName > objectNameMap = 90 Util.createObjectNameMap( allClusteredServerConfigObjectNames ); 91 92 final Map <String ,ObjectName > clusteredServerConfigObjectNameMap = 93 new HashMap <String ,ObjectName >( allClusteredServerConfigObjectNames.size() ); 94 95 for( final String key : serverRefConfigMap.keySet() ) 96 { 97 clusteredServerConfigObjectNameMap.put( key, objectNameMap.get( key ) ); 98 } 99 return clusteredServerConfigObjectNameMap; 100 } 101 102 103 } 104 105 106 107 | Popular Tags |