/** * receives notiification of the value for a particular tag * * @param element the xml element * @param value it's associated value */ public void setElementValue(XMLElement element, String value) { if (WebTagNames.SERVLET_CLASS.equals(element.getQName())) { descriptor.setServlet(true); descriptor.setWebComponentImplementation(value); } else if (WebTagNames.JSP_FILENAME.equals(element.getQName())) { descriptor.setServlet(false); descriptor.setWebComponentImplementation(value); } else if (WebTagNames.LOAD_ON_STARTUP.equals(element.getQName())) { if (value.trim().equals("")) { descriptor.setLoadOnStartUp(Integer.MAX_VALUE); } else { descriptor.setLoadOnStartUp(Integer.valueOf(value)); } } else if (WebTagNames.ENABLED.equals(element.getQName())) { descriptor.setEnabled(Boolean.parseBoolean(value)); } else if (WebTagNames.ASYNC_SUPPORTED.equals(element.getQName())) { descriptor.setAsyncSupported(Boolean.valueOf(value)); } else { super.setElementValue(element, value); } }
/** * visit a web component descriptor * * @param descriptor the web component */ public void accept(WebComponentDescriptor descriptor) { //set default value if (descriptor.getLoadOnStartUp() == null) { descriptor.setLoadOnStartUp(-1); } if (descriptor.isAsyncSupported() == null) { descriptor.setAsyncSupported(false); } MultipartConfig multipartConfig = descriptor.getMultipartConfig(); if (multipartConfig != null) { if (multipartConfig.getMaxFileSize() == null) { multipartConfig.setMaxFileSize(new Long(-1)); } if (multipartConfig.getMaxRequestSize() == null) { multipartConfig.setMaxRequestSize(new Long(-1)); } if (multipartConfig.getFileSizeThreshold() == null) { multipartConfig.setFileSizeThreshold(new Integer(0)); } } computeRuntimeDefault(descriptor); }
setAsyncSupported(other.isAsyncSupported());
/** * The copy constructor. */ public WebComponentDescriptor(WebComponentDescriptor other) { setCanonicalName(other.getCanonicalName()); setServlet(other.isServlet()); setWebComponentImplementation( other.getWebComponentImplementation()); getInitializationParameterSet().addAll( other.getInitializationParameterSet()); getUrlPatternsSet().addAll(other.getUrlPatternsSet()); setLoadOnStartUp(other.getLoadOnStartUp()); getSecurityRoleReferenceSet().addAll( other.getSecurityRoleReferenceSet()); setRunAsIdentity(other.getRunAsIdentity()); setAsyncSupported(other.isAsyncSupported()); setMultipartConfig(other.getMultipartConfig()); setWebBundleDescriptor(other.getWebBundleDescriptor()); setConflict(other.isConflict()); }
webCompDesc.setAsyncSupported(webServletAn.asyncSupported());