1 23 24 29 package com.sun.enterprise.management.j2ee; 30 31 import java.util.Map ; 32 import java.util.Set ; 33 34 import javax.management.ObjectName ; 35 36 import com.sun.appserv.management.j2ee.J2EETypes; 37 import com.sun.appserv.management.j2ee.J2EEDomain; 38 import com.sun.appserv.management.j2ee.J2EEServer; 39 import com.sun.appserv.management.j2ee.J2EECluster; 40 import com.sun.appserv.management.base.XTypes; 41 42 43 import com.sun.appserv.management.base.Util; 44 import com.sun.appserv.management.util.misc.CollectionUtil; 45 import com.sun.appserv.management.util.misc.GSetUtil; 46 47 49 public final class J2EEDomainImpl extends J2EEManagedObjectImplBase 50 { 51 public 52 J2EEDomainImpl() 53 { 54 } 55 56 public boolean 57 isConfigProvider() 58 { 59 return( true ); 60 } 61 62 private static final Set <String > NOT_SUPERFLUOUS = 63 GSetUtil.newUnmodifiableStringSet( "getServerObjectNameMap", "getClusterObjectNameMap" ); 64 65 protected final Set <String > 66 getNotSuperfluousMethods() 67 { 68 return GSetUtil.newSet( super.getNotSuperfluousMethods(), NOT_SUPERFLUOUS ); 69 } 70 71 public Map <String ,ObjectName > 72 getServerObjectNameMap() 73 { 74 return Util.toObjectNames( getSelfProxy().getJ2EEServerMap() ); 75 } 76 77 public Map <String ,ObjectName > 78 getClusterObjectNameMap() 79 { 80 return Util.toObjectNames( getSelfProxy().getJ2EEClusterMap() ); 81 } 82 83 private J2EEDomain 84 getSelfProxy() 85 { 86 return (J2EEDomain)getSelf(); 87 } 88 89 93 public String [] 94 getservers() 95 { 96 final Map <String ,J2EEServer> servers = getSelfProxy().getJ2EEServerMap(); 97 final Map <String ,ObjectName > objectNames = Util.toObjectNames( servers ); 98 return( CollectionUtil.toStringArray( objectNames.values() ) ); 99 } 100 101 public ObjectName 102 getConfigPeerObjectName() 103 { 104 return Util.getObjectName( getDomainRoot().getDomainConfig() ); 105 } 106 107 111 public String [] 112 getclusters() 113 { 114 final Map <String ,J2EECluster> clusters = getSelfProxy().getJ2EEClusterMap(); 115 final Map <String ,ObjectName > objectNames = Util.toObjectNames( clusters ); 116 return( CollectionUtil.toStringArray( objectNames.values() ) ); 117 } 118 } 119 120 121 | Popular Tags |