1 23 24 package com.sun.enterprise.deployment.runtime.web; 25 26 import java.beans.*; 27 import java.util.*; 28 29 import com.sun.enterprise.deployment.node.XMLElement; 30 31 import com.sun.enterprise.deployment.runtime.RuntimeDescriptor; 32 import com.sun.enterprise.deployment.runtime.common.EjbRef; 33 import com.sun.enterprise.deployment.runtime.common.ResourceEnvRef; 34 import com.sun.enterprise.deployment.runtime.common.ResourceRef; 35 import com.sun.enterprise.deployment.runtime.common.SecurityRoleMapping; 36 37 39 public class SunWebApp extends WebPropertyContainer 40 { 41 42 static public final String SECURITY_ROLE_MAPPING = "SecurityRoleMapping"; static public final String SERVLET = "Servlet"; static public final String SESSION_CONFIG = "SessionConfig"; static public final String RESOURCE_ENV_REF = "ResourceEnvRef"; static public final String RESOURCE_REF = "ResourceRef"; static public final String EJB_REF = "EjbRef"; static public final String CACHE = "Cache"; static public final String CLASS_LOADER = "ClassLoader"; static public final String JSP_CONFIG = "JspConfig"; static public final String LOCALE_CHARSET_INFO = "LocaleCharsetInfo"; static public final String PARAMETER_ENCODING = "ParameterEncoding"; 53 static public final String FORM_HINT_FIELD = "FormHintField"; 54 static public final String DEFAULT_CHARSET = "DefaultCharset"; 55 public static final String IDEMPOTENT_URL_PATTERN = "IdempotentUrlPattern"; 56 public static final String ERROR_URL = "ErrorUrl"; 57 public static final String HTTPSERVLET_SECURITY_PROVIDER = "HttpServletSecurityProvider"; 58 59 60 public SunWebApp() 61 { 62 setAttributeValue(CACHE, "MaxEntries", "4096"); 64 setAttributeValue(CACHE, "TimeoutInSeconds", "30"); 65 setAttributeValue(CACHE, "Enabled", "false"); 66 } 67 68 public void setSecurityRoleMapping(int index, SecurityRoleMapping value) 70 { 71 this.setValue(SECURITY_ROLE_MAPPING, index, value); 72 } 73 74 public SecurityRoleMapping getSecurityRoleMapping(int index) 76 { 77 return (SecurityRoleMapping)this.getValue(SECURITY_ROLE_MAPPING, index); 78 } 79 80 public void setSecurityRoleMapping(SecurityRoleMapping[] value) 82 { 83 this.setValue(SECURITY_ROLE_MAPPING, value); 84 } 85 86 public SecurityRoleMapping[] getSecurityRoleMapping() 88 { 89 return (SecurityRoleMapping[])this.getValues(SECURITY_ROLE_MAPPING); 90 } 91 92 public int sizeSecurityRoleMapping() 94 { 95 return this.size(SECURITY_ROLE_MAPPING); 96 } 97 98 public int addSecurityRoleMapping(SecurityRoleMapping value) 100 { 101 return this.addValue(SECURITY_ROLE_MAPPING, value); 102 } 103 104 public int removeSecurityRoleMapping(SecurityRoleMapping value) 109 { 110 return this.removeValue(SECURITY_ROLE_MAPPING, value); 111 } 112 113 public void setServlet(int index, Servlet value) 115 { 116 this.setValue(SERVLET, index, value); 117 } 118 119 public Servlet getServlet(int index) 121 { 122 return (Servlet)this.getValue(SERVLET, index); 123 } 124 125 public void setServlet(Servlet[] value) 127 { 128 this.setValue(SERVLET, value); 129 } 130 131 public Servlet[] getServlet() 133 { 134 return (Servlet[])this.getValues(SERVLET); 135 } 136 137 public int sizeServlet() 139 { 140 return this.size(SERVLET); 141 } 142 143 public int addServlet(Servlet value) 145 { 146 return this.addValue(SERVLET, value); 147 } 148 149 public int removeServlet(Servlet value) 154 { 155 return this.removeValue(SERVLET, value); 156 } 157 158 public void setIdempotentUrlPattern(int index, IdempotentUrlPattern value) 160 { 161 this.setValue(IDEMPOTENT_URL_PATTERN, index, value); 162 } 163 164 public IdempotentUrlPattern getIdempotentUrlPattern(int index) 166 { 167 return (IdempotentUrlPattern)this.getValue(IDEMPOTENT_URL_PATTERN, index); 168 } 169 170 public void setIdempotentUrlPatterns(IdempotentUrlPattern[] value) 172 { 173 this.setValue(IDEMPOTENT_URL_PATTERN, value); 174 } 175 176 public IdempotentUrlPattern[] getIdempotentUrlPatterns() 178 { 179 return (IdempotentUrlPattern[])this.getValues(IDEMPOTENT_URL_PATTERN); 180 } 181 182 public int sizeIdempotentUrlPattern() 184 { 185 return this.size(IDEMPOTENT_URL_PATTERN); 186 } 187 188 public int addIdempotentUrlPattern(IdempotentUrlPattern value) 190 { 191 return this.addValue(IDEMPOTENT_URL_PATTERN, value); 192 } 193 194 public int removeIdempotentUrlPattern(IdempotentUrlPattern value) 198 { 199 return this.removeValue(IDEMPOTENT_URL_PATTERN, value); 200 } 201 202 public void setSessionConfig(SessionConfig value) 204 { 205 this.setValue(SESSION_CONFIG, value); 206 } 207 208 public SessionConfig getSessionConfig() 210 { 211 return (SessionConfig)this.getValue(SESSION_CONFIG); 212 } 213 214 public void setResourceEnvRef(int index, ResourceEnvRef value) 216 { 217 this.setValue(RESOURCE_ENV_REF, index, value); 218 } 219 220 public ResourceEnvRef getResourceEnvRef(int index) 222 { 223 return (ResourceEnvRef)this.getValue(RESOURCE_ENV_REF, index); 224 } 225 226 public void setResourceEnvRef(ResourceEnvRef[] value) 228 { 229 this.setValue(RESOURCE_ENV_REF, value); 230 } 231 232 public ResourceEnvRef[] getResourceEnvRef() 234 { 235 return (ResourceEnvRef[])this.getValues(RESOURCE_ENV_REF); 236 } 237 238 public int sizeResourceEnvRef() 240 { 241 return this.size(RESOURCE_ENV_REF); 242 } 243 244 public int addResourceEnvRef(ResourceEnvRef value) 246 { 247 return this.addValue(RESOURCE_ENV_REF, value); 248 } 249 250 public int removeResourceEnvRef(ResourceEnvRef value) 255 { 256 return this.removeValue(RESOURCE_ENV_REF, value); 257 } 258 259 public void setResourceRef(int index, ResourceRef value) 261 { 262 this.setValue(RESOURCE_REF, index, value); 263 } 264 265 public ResourceRef getResourceRef(int index) 267 { 268 return (ResourceRef)this.getValue(RESOURCE_REF, index); 269 } 270 271 public void setResourceRef(ResourceRef[] value) 273 { 274 this.setValue(RESOURCE_REF, value); 275 } 276 277 public ResourceRef[] getResourceRef() 279 { 280 return (ResourceRef[])this.getValues(RESOURCE_REF); 281 } 282 283 public int sizeResourceRef() 285 { 286 return this.size(RESOURCE_REF); 287 } 288 289 public int addResourceRef(ResourceRef value) 291 { 292 return this.addValue(RESOURCE_REF, value); 293 } 294 295 public int removeResourceRef(ResourceRef value) 300 { 301 return this.removeValue(RESOURCE_REF, value); 302 } 303 304 public void setEjbRef(int index, EjbRef value) 306 { 307 this.setValue(EJB_REF, index, value); 308 } 309 310 public EjbRef getEjbRef(int index) 312 { 313 return (EjbRef)this.getValue(EJB_REF, index); 314 } 315 316 public void setEjbRef(EjbRef[] value) 318 { 319 this.setValue(EJB_REF, value); 320 } 321 322 public EjbRef[] getEjbRef() 324 { 325 return (EjbRef[])this.getValues(EJB_REF); 327 } 328 329 public int sizeEjbRef() 331 { 332 return this.size(EJB_REF); 333 } 334 335 public int addEjbRef(EjbRef value) 337 { 338 return this.addValue(EJB_REF, value); 339 } 340 341 public int removeEjbRef(EjbRef value) 346 { 347 return this.removeValue(EJB_REF, value); 348 } 349 350 public void setCache(Cache value) 352 { 353 this.setValue(CACHE, value); 354 } 355 356 public Cache getCache() 358 { 359 return (Cache)this.getValue(CACHE); 360 } 361 362 public void setClassLoader(ClassLoader value) 364 { 365 this.setValue(CLASS_LOADER, value); 366 } 367 368 public ClassLoader getClassLoader() 370 { 371 return (ClassLoader )this.getValue(CLASS_LOADER); 372 } 373 374 375 public void setJspConfig(JspConfig value) 377 { 378 this.setValue(JSP_CONFIG, value); 379 } 380 381 public JspConfig getJspConfig() 383 { 384 return (JspConfig)this.getValue(JSP_CONFIG); 385 } 386 387 public void setLocaleCharsetInfo(LocaleCharsetInfo value) 389 { 390 this.setValue(LOCALE_CHARSET_INFO, value); 391 } 392 393 public LocaleCharsetInfo getLocaleCharsetInfo() 395 { 396 return (LocaleCharsetInfo)this.getValue(LOCALE_CHARSET_INFO); 397 } 398 399 public boolean verify() 401 { 402 return true; 403 } 404 405 public void setParameterEncoding(boolean value) 407 { 408 this.setValue(PARAMETER_ENCODING, new Boolean (value)); 409 } 410 411 public boolean isParameterEncoding() 413 { 414 Boolean ret = (Boolean )this.getValue(PARAMETER_ENCODING); 415 if (ret == null) { 416 return false; 417 } 418 return ret.booleanValue(); 419 } 420 } 421 | Popular Tags |