1 23 24 package com.sun.enterprise.deployment.util; 25 26 import java.util.Iterator ; 27 import java.util.Vector ; 28 import java.util.jar.Manifest ; 29 import java.io.IOException ; 30 31 import javax.enterprise.deploy.shared.ModuleType ; 32 33 import com.sun.enterprise.deployment.Descriptor; 34 import com.sun.enterprise.deployment.BundleDescriptor; 35 import com.sun.enterprise.deployment.DeploymentExtensionDescriptor; 36 37 43 public class ModuleDescriptor extends Descriptor { 44 45 48 private ModuleType type; 49 50 53 private String path; 54 55 58 private String altDD; 59 60 63 private String contextRoot; 64 65 68 private BundleDescriptor descriptor; 69 70 73 private Manifest manifest; 74 75 78 private boolean standalone=false; 79 80 81 public ModuleDescriptor() { 82 } 83 84 public void setModuleType(ModuleType type) { 85 this.type = type; 86 } 87 88 89 92 public ModuleType getModuleType() { 93 if (descriptor!=null) { 94 return descriptor.getModuleType(); 95 } 96 return type; 97 } 98 99 104 public void setArchiveUri(String path) { 105 this.path = path; 106 } 107 108 111 public String getArchiveUri() { 112 return path; 113 } 114 115 120 public void setAlternateDescriptor(String altDD) { 121 this.altDD = altDD; 122 } 123 124 129 public String getAlternateDescriptor() { 130 return altDD; 131 } 132 133 138 public void setDescriptor(BundleDescriptor descriptor) { 139 descriptor.setModuleDescriptor(this); 140 this.descriptor = descriptor; 141 } 142 143 146 public BundleDescriptor getDescriptor() { 147 return descriptor; 148 } 149 150 154 public void setContextRoot(String contextRoot) { 155 this.contextRoot = contextRoot; 156 } 157 158 161 public String getContextRoot() { 162 return contextRoot; 163 } 164 165 169 public Manifest getManifest() { 170 return manifest; 171 } 172 173 177 public void setManifest(Manifest m) { 178 manifest = m; 179 } 180 181 184 public boolean isStandalone() { 185 return standalone; 186 } 187 188 191 public void setStandalone(boolean standalone) { 192 this.standalone = standalone; 193 } 194 195 199 public void addWebDeploymentExtension(DeploymentExtensionDescriptor de) { 200 Vector extensions = (Vector ) getExtraAttribute("web-deployment-extension"); 201 if (extensions==null) { 202 extensions = new Vector (); 203 addExtraAttribute("web-deployment-extension", extensions); 204 } 205 extensions.add(de); 206 } 207 208 211 public Iterator getWebDeploymentExtensions() { 212 Vector extensions = (Vector ) getExtraAttribute("web-deployment-extension"); 213 if (extensions!=null) { 214 return extensions.iterator(); 215 } 216 return null; 217 } 218 219 220 223 public void print(StringBuffer toStringBuffer) { 224 toStringBuffer.append(type + " ModuleDescriptor: [ " + path + " ] , altDD = " + altDD); 225 if (contextRoot!=null) { 226 toStringBuffer.append(" , ContextRoot = " + contextRoot); 227 } 228 } 229 230 231 235 private void writeObject(java.io.ObjectOutputStream out) 236 throws IOException { 237 238 out.writeObject(path); 240 out.writeObject(altDD); 241 out.writeObject(contextRoot); 242 out.writeObject(descriptor); 243 out.writeObject(manifest); 244 out.writeBoolean(standalone); 245 } 246 247 private void readObject(java.io.ObjectInputStream in) 248 throws IOException , ClassNotFoundException { 249 250 path = (String ) in.readObject(); 252 altDD = (String ) in.readObject(); 253 contextRoot = (String ) in.readObject(); 254 descriptor = (BundleDescriptor) in.readObject(); 255 manifest = (Manifest ) in.readObject(); 256 standalone = in.readBoolean(); 257 } 258 } 259 | Popular Tags |