1 23 24 package com.sun.enterprise.deployapi; 25 26 import java.io.Serializable ; 27 import java.util.Vector ; 28 import java.util.Set ; 29 import javax.enterprise.deploy.spi.TargetModuleID ; 30 import javax.enterprise.deploy.shared.ModuleType ; 31 import javax.enterprise.deploy.spi.Target ; 32 33 34 38 public class SunTargetModuleID extends SunTarget implements TargetModuleID , Serializable { 39 40 private String moduleID; 41 private ModuleType moduleType; 42 private boolean initialized=false; 43 private SunTargetModuleID parent = null; 44 private Vector children = null; 45 private String webUrl=null; 46 47 48 public SunTargetModuleID(String moduleID, SunTarget target) { 49 super(target); 50 this.moduleID = moduleID; 51 } 52 53 60 public TargetModuleID [] getChildTargetModuleID() { 61 if (children==null) 62 return null; 63 64 TargetModuleID [] list = new TargetModuleID [children.size()]; 65 children.copyInto(list); 66 return list; 67 } 68 69 72 public String getModuleID() { 73 return moduleID; 74 } 75 76 88 public TargetModuleID getParentTargetModuleID() { 89 return parent; 90 } 91 92 98 public Target getTarget() { 99 return this; 100 } 101 102 108 public String getWebURL() { 109 return webUrl; 110 } 111 112 115 public void setWebURL(String webUrl) { 116 this.webUrl = webUrl; 117 } 118 119 122 public void addChildTargetModuleID(SunTargetModuleID child) { 123 if (children==null) { 124 children = new Vector (); 125 } 126 child.setParentTargetModuleID(this); 127 children.add(child); 128 } 129 130 133 public void setParentTargetModuleID(SunTargetModuleID parent) { 134 this.parent = parent; 135 } 136 137 141 public void setModuleType(ModuleType moduleType) { 142 this.moduleType = moduleType; 143 } 144 145 148 public ModuleType getModuleType() { 149 return moduleType; 150 } 151 152 155 public String toString() { 156 return moduleID + "_" + super.toString(); 157 } 158 159 160 163 public String debugString() { 164 String s = "TargetModuleID type " + getModuleType() + " moduleID " + toString() + " on target = " + super.toString(); 165 if (ModuleType.WAR.equals(moduleType)) { 166 s = s + " at " + getWebURL(); 167 } 168 return s; 169 } 170 171 174 public boolean equals(Object other) { 175 if (other instanceof SunTargetModuleID) { 176 SunTargetModuleID theOther = (SunTargetModuleID) other; 177 return (moduleID.equals(theOther.moduleID) && super.equals(theOther)); 178 } 179 return false; 180 } 181 } 182 | Popular Tags |