1 22 package org.jboss.management.j2ee; 23 24 import javax.management.MalformedObjectNameException ; 25 import javax.management.ObjectName ; 26 import java.util.ArrayList ; 27 import java.util.List ; 28 29 37 public class J2EEDomainTarget extends J2EEManagedObject 38 { 40 44 private List mServers = new ArrayList (); 45 46 50 53 public J2EEDomainTarget(String pDomainName) 54 throws 55 MalformedObjectNameException , 56 InvalidParentException 57 { 58 super(pDomainName, "J2EEDomain", "Manager"); 59 } 60 61 65 72 public String [] getservers() 73 { 74 return (String []) mServers.toArray(new String [mServers.size()]); 75 } 76 77 80 public String getserver(int pIndex) 81 { 82 if (pIndex >= 0 && pIndex < mServers.size()) 83 { 84 return (String ) mServers.get(pIndex); 85 } 86 return null; 87 } 88 89 public String toString() 90 { 91 return "J2EEDomainTarget { " + super.toString() + " } [ " + 92 ", servers: " + mServers + 93 " ]"; 94 } 95 96 99 public void addChild(ObjectName pChild) 100 { 101 String lType = J2EEManagedObject.getType(pChild); 102 if (J2EETypeConstants.J2EEServer.equals(lType)) 103 { 104 mServers.add(pChild.getCanonicalName()); 105 } 106 } 107 108 111 public void removeChild(ObjectName pChild) 112 { 113 String lType = J2EEManagedObject.getType(pChild); 114 if (J2EETypeConstants.J2EEServer.equals(lType)) 115 { 116 mServers.remove(pChild.getCanonicalName()); 117 } 118 } 119 } 120 | Popular Tags |