1 22 package org.jboss.web; 23 24 import java.net.URL ; 25 import java.util.HashMap ; 26 import java.util.Map ; 27 import java.util.Properties ; 28 29 import org.jboss.metadata.WebMetaData; 30 import org.jboss.deployers.spi.deployer.DeploymentUnit; 31 import org.jboss.deployment.DeploymentInfo; 32 33 40 public class WebApplication 41 { 42 43 private DeploymentUnit unit; 44 45 protected ClassLoader classLoader = null; 46 47 protected String name = ""; 48 protected String canonicalName; 49 50 protected URL url; 51 52 protected WebMetaData metaData; 53 54 protected Object data; 55 56 protected String domain; 57 60 protected boolean java2ClassLoadingCompliance = false; 61 64 protected boolean unpackWars = true; 65 69 protected boolean lenientEjbLink = false; 70 73 protected String defaultSecurityDomain; 74 protected HashMap vhostToHostNames = new HashMap (); 75 76 protected Object deployerConfig; 77 78 80 public WebApplication() 81 { 82 } 83 84 88 public WebApplication(WebMetaData metaData) 89 { 90 this.metaData = metaData; 91 } 92 93 99 public WebApplication(String name, URL url, ClassLoader classLoader) 100 { 101 this.name = name; 102 this.url = url; 103 this.classLoader = classLoader; 104 } 105 106 public DeploymentUnit getDeploymentUnit() 107 { 108 return unit; 109 } 110 public void setDeploymentUnit(DeploymentUnit unit) 111 { 112 this.unit = unit; 113 } 114 115 118 public ClassLoader getClassLoader() 119 { 120 return classLoader; 121 } 122 123 126 public void setClassLoader(ClassLoader classLoader) 127 { 128 this.classLoader = classLoader; 129 } 130 131 134 public String getName() 135 { 136 String n = name; 137 if (n == null) 138 n = url.getFile(); 139 return n; 140 } 141 142 145 public void setName(String name) 146 { 147 this.name = name; 148 } 149 150 public String getCanonicalName() 151 { 152 return canonicalName; 153 } 154 public void setCanonicalName(String canonicalName) 155 { 156 this.canonicalName = canonicalName; 157 } 158 159 162 public URL getURL() 163 { 164 return url; 165 } 166 167 170 public void setURL(URL url) 171 { 172 if (url == null) 173 throw new IllegalArgumentException ("Null URL"); 174 this.url = url; 175 } 176 177 180 public WebMetaData getMetaData() 181 { 182 return metaData; 183 } 184 185 188 public void setMetaData(WebMetaData metaData) 189 { 190 this.metaData = metaData; 191 } 192 193 public Object getAppData() 194 { 195 return data; 196 } 197 198 public void setAppData(Object data) 199 { 200 this.data = data; 201 } 202 203 204 public String getDomain() 205 { 206 return domain; 207 } 208 public void setDomain(String domain) 209 { 210 this.domain = domain; 211 } 212 218 public boolean getJava2ClassLoadingCompliance() 219 { 220 return java2ClassLoadingCompliance; 221 } 222 223 229 public void setJava2ClassLoadingCompliance(boolean flag) 230 { 231 java2ClassLoadingCompliance = flag; 232 } 233 234 241 public boolean getUnpackWars() 242 { 243 return unpackWars; 244 } 245 246 253 public void setUnpackWars(boolean flag) 254 { 255 this.unpackWars = flag; 256 } 257 258 264 public boolean getLenientEjbLink() 265 { 266 return lenientEjbLink; 267 } 268 269 274 public void setLenientEjbLink(boolean flag) 275 { 276 lenientEjbLink = flag; 277 } 278 279 285 public String getDefaultSecurityDomain() 286 { 287 return defaultSecurityDomain; 288 } 289 290 297 public void setDefaultSecurityDomain(String defaultSecurityDomain) 298 { 299 this.defaultSecurityDomain = defaultSecurityDomain; 300 } 301 302 public Map getVhostToHostNames() 303 { 304 return this.vhostToHostNames; 305 } 306 public void setVhostToHostNames(Map map) 307 { 308 this.vhostToHostNames.clear(); 309 this.vhostToHostNames.putAll(map); 310 } 311 312 public Object getDeployerConfig() 313 { 314 return deployerConfig; 315 } 316 public void setDeployerConfig(Object config) 317 { 318 this.deployerConfig = config; 319 } 320 321 public String toString() 322 { 323 StringBuffer buffer = new StringBuffer ("{WebApplication: "); 324 buffer.append(getName()); 325 buffer.append(", URL: "); 326 buffer.append(url); 327 buffer.append(", classLoader: "); 328 buffer.append(classLoader); 329 buffer.append(':'); 330 buffer.append(classLoader.hashCode()); 331 buffer.append('}'); 332 return buffer.toString(); 333 } 334 335 } 336 | Popular Tags |