1 19 20 package org.netbeans.modules.j2ee.sun.share.configbean; 21 22 import java.io.IOException ; 23 import java.util.ArrayList ; 24 import java.util.Collection ; 25 import java.util.HashMap ; 26 import java.util.Iterator ; 27 import java.util.List ; 28 import java.text.MessageFormat ; 29 import java.util.Map ; 30 31 import javax.enterprise.deploy.model.DDBean ; 32 import javax.enterprise.deploy.model.DDBeanRoot ; 33 import javax.enterprise.deploy.spi.DConfigBean ; 34 import javax.enterprise.deploy.spi.exceptions.ConfigurationException ; 35 36 import org.xml.sax.SAXException ; 37 38 import org.openide.ErrorManager; 39 40 import org.netbeans.modules.j2ee.sun.dd.api.CommonDDBean; 41 import org.netbeans.modules.j2ee.sun.dd.api.DDException; 42 import org.netbeans.modules.j2ee.sun.dd.api.DDProvider; 43 import org.netbeans.modules.j2ee.sun.dd.api.VersionNotSupportedException; 44 import org.netbeans.modules.j2ee.sun.dd.api.web.SunWebApp; 45 import org.netbeans.modules.j2ee.sun.dd.api.web.MyClassLoader; 46 import org.netbeans.modules.j2ee.sun.dd.api.web.JspConfig; 47 import org.netbeans.modules.j2ee.sun.dd.api.web.LocaleCharsetInfo; 48 import org.netbeans.modules.j2ee.sun.dd.api.web.WebProperty; 49 import org.netbeans.modules.j2ee.sun.dd.api.common.MessageDestination; 50 51 import org.netbeans.modules.j2ee.sun.share.configbean.Base.DefaultSnippet; 52 53 54 105 public class WebAppRoot extends BaseRoot implements javax.enterprise.deploy.spi.DConfigBean { 106 107 110 public static final String SERVLET_LIST_CHANGED = "ServletListChanged"; 112 private static final String JSPCONFIG_CLASSDEBUGINFO="classdebuginfo"; private static final String JSPCONFIG_MAPPEDFILE="mappedfile"; 115 public WebAppRoot() { 116 setDescriptorElement(bundle.getString("BDN_WebAppRoot")); } 118 119 protected void init(DDBeanRoot dDBean, SunONEDeploymentConfiguration parent, DDBean ddbExtra) throws ConfigurationException { 120 super.init(dDBean, parent, ddbExtra); 121 122 sessionConfigBean = new SessionConfigSubBean(); 123 sessionConfigBean.init(this); 124 125 cacheBean = new WebAppCache(); 126 cacheBean.init(this); 127 128 loadFromPlanFile(parent); 129 } 130 131 134 135 public static final String FIELD_FORM_HINT="locale-charset-info/parameter-encoding/form-hint-field"; 138 139 protected void updateValidationFieldList() { 140 super.updateValidationFieldList(); 141 validationFieldList.add(FIELD_FORM_HINT); 143 } 144 145 public boolean validateField(String fieldId) { 146 ValidationError error = null; 147 148 168 if(fieldId.equals(FIELD_FORM_HINT)) { 169 String absoluteFieldXpath = getAbsoluteXpath(fieldId); 170 171 if(localeInfo != null) { 172 String formHint = localeInfo.getParameterEncodingFormHintField(); 173 if(Utils.notEmpty(formHint)) { 174 if(!Utils.isJavaIdentifier(formHint)) { 175 Object [] args = new Object [1]; 176 args[0] = "form-hint-field"; String message = MessageFormat.format(bundle.getString("ERR_NotValidIdentifier"), args); error = ValidationError.getValidationError(ValidationError.PARTITION_WEB_LOCALE, absoluteFieldXpath, message); 179 } 180 } 181 } 182 183 if(error == null) { 184 error = ValidationError.getValidationErrorMask(ValidationError.PARTITION_WEB_LOCALE, absoluteFieldXpath); 185 } 186 } 187 188 if(error != null) { 189 getMessageDB().updateError(error); 190 } 191 192 return (error == null || !Utils.notEmpty(error.getMessage())); 194 } 195 196 199 public String getHelpId() { 200 return "AS_CFG_WebAppGeneral"; 201 } 202 203 public DConfigBean getDConfigBean(DDBeanRoot dDBeanRoot) { 204 BaseRoot rootDCBean = null; 205 206 J2EEBaseVersion moduleVersion = getJ2EEModuleVersion(); 207 if(moduleVersion.compareTo(ServletVersion.SERVLET_2_4) >= 0) { 208 rootDCBean = createWebServicesRoot(dDBeanRoot); 209 } 210 211 return rootDCBean; 212 } 213 214 218 public J2EEBaseVersion getJ2EEModuleVersion() { 219 DDBeanRoot ddbRoot = (DDBeanRoot ) getDDBean(); 220 221 String versionString = ddbRoot.getDDBeanRootVersion(); 223 if(versionString == null) { 224 versionString = ddbRoot.getModuleDTDVersion(); 226 } 227 228 J2EEBaseVersion servletVersion = ServletVersion.getServletVersion(versionString); 229 if(servletVersion == null) { 230 servletVersion = ServletVersion.SERVLET_2_4; 232 } 233 234 return servletVersion; 235 } 236 237 240 public String generateDocType(ASDDVersion version) { 241 return generateDocType("sun-web-app", version.getSunWebAppPublicId(), version.getSunWebAppSystemId()); } 243 244 248 protected void beanAdded(String xpath) { 249 super.beanAdded(xpath); 250 251 if("/web-app/servlet".equals(xpath)) { getPCS().firePropertyChange(SERVLET_LIST_CHANGED, false, true); 253 } 254 } 255 256 260 protected void beanRemoved(String xpath) { 261 super.beanRemoved(xpath); 262 263 if("/web-app/servlet".equals(xpath)) { getPCS().firePropertyChange(SERVLET_LIST_CHANGED, false, true); 265 } 266 } 267 268 271 public List getServlets() { 272 List servlets = new ArrayList (); 273 for(Iterator iter = getChildren().iterator(); iter.hasNext(); ) { 274 Object child = iter.next(); 275 if(child instanceof ServletRef) { 276 servlets.add(child); 277 } 278 } 279 return servlets; 280 } 281 282 286 Collection getSnippets() { 287 Collection snippets = new ArrayList (); 288 Snippet snipOne = new DefaultSnippet() { 289 public CommonDDBean getDDSnippet() { 290 SunWebApp swa = getConfig().getStorageFactory().createSunWebApp(); 291 String version = swa.getVersion().toString(); 292 293 if(contextRoot != null) { 294 swa.setContextRoot(contextRoot); 295 } 296 297 if(errorUrl != null) { 298 try { 299 swa.setErrorUrl(errorUrl); 300 } catch(VersionNotSupportedException ex) { 301 } 302 } 303 304 if(httpservletSecurityProvider != null) { 305 try { 306 swa.setHttpservletSecurityProvider(httpservletSecurityProvider); 307 } catch(VersionNotSupportedException ex) { 308 } 309 } 310 311 if(classLoader != null) { 312 if(classLoader.toString().equals("true")){ try { 314 MyClassLoader webClassLoader = swa.newMyClassLoader(); 315 316 if(delegate != null) { 317 webClassLoader.setDelegate(Boolean.toString(isDelegate())); 318 } else { 319 webClassLoader.setDelegate(Boolean.TRUE.toString()); 320 } 321 322 if(Utils.notEmpty(getExtraClassPath())) { 323 webClassLoader.setExtraClassPath(getExtraClassPath()); 324 } 325 326 if(Utils.notEmpty(getDynamicReloadInterval())) { 327 webClassLoader.setDynamicReloadInterval(getDynamicReloadInterval()); 328 } 329 330 WebProperty [] classLoaderProps = (WebProperty []) 331 Utils.listToArray(getClassLoaderProperties(), WebProperty.class, version); 332 if(classLoaderProps != null) { 333 webClassLoader.setWebProperty(classLoaderProps); 334 } 335 336 swa.setMyClassLoader(webClassLoader); 337 } catch(VersionNotSupportedException ex) { 338 } 340 } 341 } 342 343 try { 344 if(Utils.notEmpty(defaultCharset) || Utils.notEmpty(formHintField)) { 345 swa.setParameterEncoding(true); 346 swa.setParameterEncodingDefaultCharset(defaultCharset); 347 swa.setParameterEncodingFormHintField(formHintField); 348 } 349 350 int numPatterns = idempotentUrlPattern.sizeIdempotentUrlPattern(); 351 if(numPatterns > 0) { 352 swa.setIdempotentUrlPattern(new boolean[numPatterns]); 353 for(int i = 0; i < numPatterns; i++) { 354 swa.setIdempotentUrlPatternUrlPattern(i, idempotentUrlPattern.getIdempotentUrlPatternUrlPattern(i)); 355 swa.setIdempotentUrlPatternNumOfRetries(i, idempotentUrlPattern.getIdempotentUrlPatternNumOfRetries(i)); 356 } 357 } 358 } catch(VersionNotSupportedException ex) { 359 } 361 362 JspConfig jc = getJspConfig(); 363 if(jc.sizeWebProperty() > 0) { 364 swa.setJspConfig((JspConfig) jc.cloneVersion(version)); 365 } 366 367 WebProperty [] webProps = (WebProperty []) 368 Utils.listToArray(getProperties(), WebProperty.class, version); 369 if(webProps != null) { 370 swa.setWebProperty(webProps); 371 } 372 373 MessageDestination [] msgDests = (MessageDestination []) 374 Utils.listToArray(getMessageDestinations(), MessageDestination.class, version); 375 if(msgDests != null) { 376 swa.setMessageDestination(msgDests); 377 } 378 379 if(localeInfo.sizeLocaleCharsetMap() > 0 || 380 Utils.notEmpty(localeInfo.getDefaultLocale()) || 381 Utils.notEmpty(localeInfo.getParameterEncodingDefaultCharset()) || 382 Utils.notEmpty(localeInfo.getParameterEncodingFormHintField()) 383 ) { 384 swa.setLocaleCharsetInfo((LocaleCharsetInfo) localeInfo.cloneVersion(version)); 385 } 386 387 390 393 395 restoreAllNamedBeans(swa, version); 396 397 return swa; 398 } 399 }; 400 401 snippets.add(snipOne); 402 snippets.addAll(sessionConfigBean.getSnippets()); 403 snippets.addAll(cacheBean.getSnippets()); 404 return snippets; 405 } 406 407 private class WebAppRootParser implements ConfigParser { 408 public Object parse(java.io.InputStream stream) throws IOException , SAXException , DDException { 409 DDProvider provider = DDProvider.getDefault(); 410 SunWebApp result = null; 411 412 if(stream != null) { 413 result = provider.getWebDDRoot(new org.xml.sax.InputSource (stream)); 415 } else { 416 result = (SunWebApp) provider.newGraph(SunWebApp.class, 418 getConfig().getAppServerVersion().getWebAppVersionAsString()); 419 } 420 421 getConfig().internalSetAppServerVersion(ASDDVersion.getASDDVersionFromServletVersion(result.getVersion())); 423 424 return result; 425 } 426 } 427 428 private class WebAppRootFinder implements ConfigFinder { 429 public Object find(Object obj) { 430 SunWebApp result = null; 431 432 if(obj instanceof SunWebApp) { 433 result = (SunWebApp) obj; 434 } 435 436 return result; 437 } 438 } 439 440 protected ConfigParser getParser() { 441 return new WebAppRootParser(); 442 } 443 444 boolean loadFromPlanFile(SunONEDeploymentConfiguration config) { 445 String uriText = getUriText(); 446 447 SunWebApp beanGraph = (SunWebApp) config.getBeans(uriText, constructFileName(), 448 getParser(), new WebAppRootFinder()); 449 450 clearProperties(); 451 452 if(null != beanGraph) { 453 contextRoot = beanGraph.getContextRoot(); 454 455 try { 456 errorUrl = beanGraph.getErrorUrl(); 457 } catch(VersionNotSupportedException ex) { 458 errorUrl = ""; 459 } 460 461 try { 462 httpservletSecurityProvider = beanGraph.getHttpservletSecurityProvider(); 463 } catch(VersionNotSupportedException ex) { 464 httpservletSecurityProvider = ""; 465 } 466 467 try { 468 MyClassLoader myClassLoader = beanGraph.getMyClassLoader(); 470 if(myClassLoader != null) { 471 delegate = Utils.booleanValueOf(myClassLoader.getDelegate()) ? Boolean.TRUE : Boolean.FALSE; 472 extraClassPath = myClassLoader.getExtraClassPath(); 473 dynamicReloadInterval = myClassLoader.getDynamicReloadInterval(); 474 classLoaderProperties = Utils.arrayToList(myClassLoader.getWebProperty()); 475 if((delegate != null) || (extraClassPath != null) || (dynamicReloadInterval != null) || 476 (classLoaderProperties != null && classLoaderProperties.size() > 0)) { 477 classLoader = Boolean.TRUE; 478 } 479 } 480 } catch(VersionNotSupportedException ex) { 481 delegate = Boolean.TRUE; 483 classLoader = Boolean.TRUE; 484 } 485 486 try { 487 defaultCharset = beanGraph.getParameterEncodingDefaultCharset(); 488 formHintField = beanGraph.getParameterEncodingFormHintField(); 489 490 int numPatterns = beanGraph.sizeIdempotentUrlPattern(); 491 if(numPatterns > 0) { 492 idempotentUrlPattern.setIdempotentUrlPattern(new boolean[numPatterns]); 493 for(int i = 0; i < numPatterns; i++) { 494 idempotentUrlPattern.setIdempotentUrlPatternUrlPattern(i, beanGraph.getIdempotentUrlPatternUrlPattern(i)); 495 idempotentUrlPattern.setIdempotentUrlPatternNumOfRetries(i, beanGraph.getIdempotentUrlPatternNumOfRetries(i)); 496 } 497 } 498 } catch(VersionNotSupportedException ex) { 499 } 501 502 JspConfig jc = beanGraph.getJspConfig(); 503 if(jc != null && jc.sizeWebProperty() > 0) { 504 jspConfig = (JspConfig) jc.clone(); 505 } 506 507 properties = Utils.arrayToList(beanGraph.getWebProperty()); 508 messageDestinations = Utils.arrayToList(beanGraph.getMessageDestination()); 509 510 LocaleCharsetInfo info = beanGraph.getLocaleCharsetInfo(); 515 if(info != null && 516 (info.sizeLocaleCharsetMap() > 0 || 517 Utils.notEmpty(info.getDefaultLocale()) || 518 Utils.notEmpty(info.getParameterEncodingDefaultCharset()) || 519 Utils.notEmpty(info.getParameterEncodingFormHintField()) 520 )) { 521 localeInfo = (LocaleCharsetInfo) info.clone(); 522 } 523 524 saveAllNamedBeans(beanGraph); 526 } else { 527 setDefaultProperties(); 528 } 529 530 sessionConfigBean.loadFromPlanFile(config); 532 533 cacheBean.loadFromPlanFile(config); 535 536 return (beanGraph != null); 537 } 538 539 protected void clearProperties() { 540 StorageBeanFactory beanFactory = getConfig().getStorageFactory(); 541 542 contextRoot = null; 543 errorUrl = null; 544 httpservletSecurityProvider = null; 545 extraClassPath = null; 546 dynamicReloadInterval = null; 547 classLoaderProperties = null; 548 defaultCharset = null; 549 formHintField = null; 550 idempotentUrlPattern = beanFactory.createSunWebApp(); 551 jspConfig = beanFactory.createJspConfig(); 552 properties = null; 553 messageDestinations = null; 554 localeInfo = beanFactory.createLocaleCharsetInfo(); 555 556 classLoader = Boolean.FALSE; 557 delegate = Boolean.FALSE; 558 } 559 560 protected void setDefaultProperties() { 561 StorageBeanFactory beanFactory = getConfig().getStorageFactory(); 562 563 WebProperty classDebugInfoProperty = beanFactory.createWebProperty(); 566 classDebugInfoProperty.setName(JSPCONFIG_CLASSDEBUGINFO); 567 classDebugInfoProperty.setValue("true"); classDebugInfoProperty.setDescription(bundle.getString("DESC_ClassDebugInfo")); jspConfig.addWebProperty(classDebugInfoProperty); 570 571 WebProperty mappedFileProperty = beanFactory.createWebProperty(); 572 mappedFileProperty.setName(JSPCONFIG_MAPPEDFILE); 573 mappedFileProperty.setValue("true"); mappedFileProperty.setDescription(bundle.getString("DESC_MappedFile")); jspConfig.addWebProperty(mappedFileProperty); 576 577 classLoader = Boolean.TRUE; 578 delegate = Boolean.TRUE; 579 580 errorUrl = ""; 582 } 583 584 private static Collection sunWebAppBeanSpecs = new ArrayList (); 585 586 static { 587 sunWebAppBeanSpecs.addAll(getCommonNamedBeanSpecs()); 588 sunWebAppBeanSpecs.add(new NamedBean(SunWebApp.SECURITY_ROLE_MAPPING, 591 org.netbeans.modules.j2ee.sun.dd.api.common.SecurityRoleMapping.ROLE_NAME)); 592 sunWebAppBeanSpecs.add(new NamedBean(SunWebApp.SERVLET, 593 org.netbeans.modules.j2ee.sun.dd.api.web.Servlet.SERVLET_NAME)); 594 } 595 596 protected Collection getNamedBeanSpecs() { 597 return sunWebAppBeanSpecs; 598 } 599 600 603 private HashMap webAppRootFactoryMap; 604 605 610 protected java.util.Map getXPathToFactoryMap() { 611 if(webAppRootFactoryMap == null) { 612 webAppRootFactoryMap = new HashMap (17); 613 614 webAppRootFactoryMap.put("ejb-ref", new DCBGenericFactory(EjbRef.class)); webAppRootFactoryMap.put("resource-env-ref", new DCBGenericFactory(ResourceEnvRef.class)); webAppRootFactoryMap.put("resource-ref", new DCBGenericFactory(ResourceRef.class)); webAppRootFactoryMap.put("security-role", new DCBGenericFactory(SecurityRoleMapping.class)); webAppRootFactoryMap.put("servlet", new DCBGenericFactory(ServletRef.class)); 620 623 J2EEBaseVersion moduleVersion = getJ2EEModuleVersion(); 624 if(moduleVersion.compareTo(ServletVersion.SERVLET_2_4) >= 0) { 625 webAppRootFactoryMap.put("service-ref", new DCBGenericFactory(ServiceRef.class)); 628 if(moduleVersion.compareTo(ServletVersion.SERVLET_2_5) >= 0) { 629 webAppRootFactoryMap.put("message-destination-ref", new DCBGenericFactory(MessageDestinationRef.class)); } 631 } 632 } 633 634 return webAppRootFactoryMap; 635 } 636 637 640 641 642 private String contextRoot; 643 644 645 private String errorUrl; 646 647 648 private String httpservletSecurityProvider; 649 650 651 private Boolean classLoader; 652 653 654 private String extraClassPath; 655 656 657 private Boolean delegate; 658 659 660 private String dynamicReloadInterval; 661 662 663 private List classLoaderProperties; 664 665 666 private String defaultCharset; 667 668 669 private String formHintField; 670 671 672 private SunWebApp idempotentUrlPattern; 673 674 675 private JspConfig jspConfig; 676 677 678 private List properties; 679 680 681 private List messageDestinations; 682 683 684 private LocaleCharsetInfo localeInfo; 685 686 687 private SessionConfigSubBean sessionConfigBean; 688 689 690 private WebAppCache cacheBean; 691 692 696 public String getContextRoot() { 697 return contextRoot; 698 } 699 700 706 public void setContextRoot(String newContextRoot) throws java.beans.PropertyVetoException { 707 newContextRoot = Utils.encodeUrlField(newContextRoot); 708 String oldContextRoot = contextRoot; 709 getVCS().fireVetoableChange("contextRoot", oldContextRoot, newContextRoot); 710 contextRoot = newContextRoot; 711 getPCS().firePropertyChange("contextRoot", oldContextRoot, contextRoot); 712 } 713 714 718 public String getErrorUrl() { 719 return errorUrl; 720 } 721 722 728 public void setErrorUrl(String newErrorUrl) throws java.beans.PropertyVetoException { 729 newErrorUrl = Utils.encodeUrlField(newErrorUrl); 730 String oldErrorUrl = errorUrl; 731 getVCS().fireVetoableChange("errorUrl", oldErrorUrl, newErrorUrl); 732 errorUrl = newErrorUrl; 733 getPCS().firePropertyChange("errorUrl", oldErrorUrl, errorUrl); 734 } 735 736 740 public String getHttpservletSecurityProvider() { 741 return httpservletSecurityProvider; 742 } 743 744 750 public void setHttpservletSecurityProvider(String newHttpservletSecurityProvider) throws java.beans.PropertyVetoException { 751 String oldHttpservletSecurityProvider = httpservletSecurityProvider; 752 getVCS().fireVetoableChange("httpservletSecurityProvider", oldHttpservletSecurityProvider, newHttpservletSecurityProvider); 753 httpservletSecurityProvider = newHttpservletSecurityProvider; 754 getPCS().firePropertyChange("httpservletSecurityProvider", oldHttpservletSecurityProvider, httpservletSecurityProvider); 755 } 756 757 761 public boolean isClassLoader() { 762 return classLoader.booleanValue(); 763 } 764 765 771 public void setClassLoader(boolean newClassLoader) throws java.beans.PropertyVetoException { 772 Boolean oldClassLoader = classLoader; 773 Boolean newClassLoaderAsBoolean = newClassLoader ? Boolean.TRUE : Boolean.FALSE; 774 getVCS().fireVetoableChange("classLoader", oldClassLoader, newClassLoaderAsBoolean); 775 classLoader = newClassLoaderAsBoolean; 776 getPCS().firePropertyChange("classLoader", oldClassLoader, classLoader); 777 } 778 779 783 public String getExtraClassPath() { 784 return extraClassPath; 785 } 786 787 793 public void setExtraClassPath(String newExtraClassPath) throws java.beans.PropertyVetoException { 794 String oldExtraClassPath = extraClassPath; 795 getVCS().fireVetoableChange("extraClassPath", oldExtraClassPath, newExtraClassPath); 796 extraClassPath = newExtraClassPath; 797 getPCS().firePropertyChange("extraClassPath", oldExtraClassPath, extraClassPath); 798 } 799 800 804 public boolean isDelegate() { 805 return delegate.booleanValue(); 806 } 807 808 814 public void setDelegate(boolean newDelegate) throws java.beans.PropertyVetoException { 815 Boolean oldDelegate = delegate; 816 Boolean newDelegateAsBoolean = newDelegate ? Boolean.TRUE : Boolean.FALSE; 817 getVCS().fireVetoableChange("delegate", oldDelegate, newDelegateAsBoolean); 818 delegate = newDelegateAsBoolean; 819 getPCS().firePropertyChange("delegate", oldDelegate, delegate); 820 } 821 822 826 public String getDynamicReloadInterval() { 827 return dynamicReloadInterval; 828 } 829 830 836 public void setDynamicReloadInterval(String newDynamicReloadInterval) throws java.beans.PropertyVetoException { 837 String oldDynamicReloadInterval = dynamicReloadInterval; 838 getVCS().fireVetoableChange("dynamicReloadInterval", oldDynamicReloadInterval, newDynamicReloadInterval); 839 dynamicReloadInterval = newDynamicReloadInterval; 840 getPCS().firePropertyChange("dynamicReloadInterval", oldDynamicReloadInterval, dynamicReloadInterval); 841 } 842 843 847 public List getClassLoaderProperties() { 848 return classLoaderProperties; 849 } 850 851 public WebProperty getClassLoaderProperty(int index) { 852 return (WebProperty) classLoaderProperties.get(index); 853 } 854 855 861 public void setClassLoaderProperties(List newClassLoaderProperties) throws java.beans.PropertyVetoException { 862 List oldClassLoaderProperties = classLoaderProperties; 863 getVCS().fireVetoableChange("classLoaderProperties", oldClassLoaderProperties, newClassLoaderProperties); classLoaderProperties = newClassLoaderProperties; 865 getPCS().firePropertyChange("classLoaderProperties", oldClassLoaderProperties, classLoaderProperties); } 867 868 public void addClassLoaderProperty(WebProperty newClassLoaderProperty) throws java.beans.PropertyVetoException { 869 getVCS().fireVetoableChange("classLoaderProperty", null, newClassLoaderProperty); if(classLoaderProperties == null) { 871 classLoaderProperties = new ArrayList (); 872 } 873 classLoaderProperties.add(newClassLoaderProperty); 874 getPCS().firePropertyChange("classLoaderProperty", null, newClassLoaderProperty ); } 876 877 public void removeClassLoaderProperty(WebProperty oldClassLoaderProperty) throws java.beans.PropertyVetoException { 878 getVCS().fireVetoableChange("classLoaderProperty", oldClassLoaderProperty, null); classLoaderProperties.remove(oldClassLoaderProperty); 880 getPCS().firePropertyChange("classLoaderProperty", oldClassLoaderProperty, null ); } 882 883 887 public String getDefaultCharset() { 888 return defaultCharset; 889 } 890 891 897 public void setDefaultCharset(String newDefaultCharset) throws java.beans.PropertyVetoException { 898 String oldDefaultCharset = defaultCharset; 899 getVCS().fireVetoableChange("defaultCharset", oldDefaultCharset, newDefaultCharset); 900 defaultCharset = newDefaultCharset; 901 getPCS().firePropertyChange("defaultCharset", oldDefaultCharset, defaultCharset); 902 } 903 904 908 public String getFormHintField() { 909 return formHintField; 910 } 911 912 918 public void setFormHintField(String newFormHintField) throws java.beans.PropertyVetoException { 919 String oldFormHintField = formHintField; 920 getVCS().fireVetoableChange("formHintField", oldFormHintField, newFormHintField); 921 formHintField = newFormHintField; 922 getPCS().firePropertyChange("formHintField", oldFormHintField, formHintField); 923 } 924 925 929 public SunWebApp getIdempotentUrlPattern() { 930 return idempotentUrlPattern; 931 } 932 933 938 public void setIdempotentUrlPattern(SunWebApp newIdempotentUrlPattern) throws java.beans.PropertyVetoException { 939 SunWebApp oldIdempotentUrlPattern = idempotentUrlPattern; 940 getVCS().fireVetoableChange("idempotentUrlPatterns", oldIdempotentUrlPattern, newIdempotentUrlPattern); 941 idempotentUrlPattern = newIdempotentUrlPattern; 942 getPCS().firePropertyChange("idempotentUrlPatterns", oldIdempotentUrlPattern, idempotentUrlPattern); 943 } 944 945 971 975 public JspConfig getJspConfig() { 976 return jspConfig; 977 } 978 979 985 public void setJspConfig(JspConfig newJspConfig) throws java.beans.PropertyVetoException { 986 JspConfig oldJspConfig = jspConfig; 987 getVCS().fireVetoableChange("jspConfig", oldJspConfig, newJspConfig); 988 jspConfig = newJspConfig; 989 getPCS().firePropertyChange("jspConfig", oldJspConfig, jspConfig); 990 } 991 992 996 public List getProperties() { 997 return properties; 998 } 999 1000 public WebProperty getProperty(int index) { 1001 return (WebProperty) properties.get(index); 1002 } 1003 1004 1010 public void setProperties(List newProperties) throws java.beans.PropertyVetoException { 1011 List oldProperties = properties; 1012 getVCS().fireVetoableChange("properties", oldProperties, newProperties); properties = newProperties; 1014 getPCS().firePropertyChange("properties", oldProperties, properties); } 1016 1017 public void addProperty(WebProperty newProperty) throws java.beans.PropertyVetoException { 1018 getVCS().fireVetoableChange("property", null, newProperty); if(properties == null) { 1020 properties = new ArrayList (); 1021 } 1022 properties.add(newProperty); 1023 getPCS().firePropertyChange("property", null, newProperty ); } 1025 1026 public void removeProperty(WebProperty oldProperty) throws java.beans.PropertyVetoException { 1027 getVCS().fireVetoableChange("property", oldProperty, null); properties.remove(oldProperty); 1029 getPCS().firePropertyChange("property", oldProperty, null ); } 1031 1032 1036 public List getMessageDestinations() { 1037 return messageDestinations; 1038 } 1039 1040 public MessageDestination getMessageDestination(int index) { 1041 return (MessageDestination) messageDestinations.get(index); 1042 } 1043 1044 1050 public void setMessageDestinations(List newMessageDestinations) throws java.beans.PropertyVetoException { 1051 List oldMessageDestinations = messageDestinations; 1052 getVCS().fireVetoableChange("messageDestinations", oldMessageDestinations, newMessageDestinations); messageDestinations = newMessageDestinations; 1054 getPCS().firePropertyChange("messageDestinations", oldMessageDestinations, messageDestinations); } 1056 1057 public void addMessageDestination(MessageDestination newMessageDestination) throws java.beans.PropertyVetoException { 1058 getVCS().fireVetoableChange("messageDestination", null, newMessageDestination); if(messageDestinations == null) { 1060 messageDestinations = new ArrayList (); 1061 } 1062 messageDestinations.add(newMessageDestination); 1063 getPCS().firePropertyChange("messageDestination", null, newMessageDestination ); } 1065 1066 public void removeMessageDestination(MessageDestination oldMessageDestination) throws java.beans.PropertyVetoException { 1067 getVCS().fireVetoableChange("messageDestination", oldMessageDestination, null); messageDestinations.remove(oldMessageDestination); 1069 getPCS().firePropertyChange("messageDestination", oldMessageDestination, null ); } 1071 1072 1076 public LocaleCharsetInfo getLocaleCharsetInfo() { 1077 return localeInfo; 1078 } 1079 1080 1086 public void setLocaleCharsetInfo(LocaleCharsetInfo newLocaleInfo) throws java.beans.PropertyVetoException { 1087 LocaleCharsetInfo oldLocaleInfo = localeInfo; 1088 getVCS().fireVetoableChange("localeInfo", oldLocaleInfo, newLocaleInfo); 1089 localeInfo = newLocaleInfo; 1090 getPCS().firePropertyChange("localeInfo", oldLocaleInfo, localeInfo); 1091 } 1092 1093 1097 public SessionConfigSubBean getSessionConfigBean() { 1098 return sessionConfigBean; 1099 } 1100 1101 1105 public WebAppCache getCacheBean() { 1106 return cacheBean; 1107 } 1108} 1109 | Popular Tags |