public void setAsyncSupported(boolean asyncSupported) { if (!context.isStarting()) { throw new IllegalStateException(sm.getString("filterRegistration.ise", context.getPath())); } filterDef.setAsyncSupported(asyncSupported); context.addFilterDef(filterDef); }
public Set<String> setInitParameters(Map<String, String> initParameters) { if (!context.isStarting()) { throw new IllegalStateException(sm.getString("filterRegistration.ise", context.getPath())); } if (initParameters == null) { throw new IllegalArgumentException(sm.getString("filterRegistration.iae")); } Set<String> conflicts = new HashSet<String>(); Iterator<String> parameterNames = initParameters.keySet().iterator(); while (parameterNames.hasNext()) { String parameterName = parameterNames.next(); if (filterDef.getInitParameter(parameterName) != null) { conflicts.add(parameterName); } else { String value = initParameters.get(parameterName); if (value == null) { throw new IllegalArgumentException(sm.getString("filterRegistration.iae")); } filterDef.addInitParameter(parameterName, value); } } context.addFilterDef(filterDef); return conflicts; }
public Set<String> setInitParameters(Map<String, String> initParameters) { if (!((Context) wrapper.getParent()).isStarting()) { throw new IllegalStateException(sm.getString ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath())); } if (initParameters == null) { throw new IllegalArgumentException(sm.getString("servletRegistration.iae")); } Set<String> conflicts = new HashSet<String>(); Iterator<String> parameterNames = initParameters.keySet().iterator(); while (parameterNames.hasNext()) { String parameterName = parameterNames.next(); if (wrapper.findInitParameter(parameterName) != null) { conflicts.add(parameterName); } else { String value = initParameters.get(parameterName); if (value == null) { throw new IllegalArgumentException(sm.getString("servletRegistration.iae")); } wrapper.addInitParameter(parameterName, value); } } return conflicts; }
public void setRunAsRole(String roleName) { if (!((Context) wrapper.getParent()).isStarting()) { throw new IllegalStateException(sm.getString ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath())); } if (roleName == null) { throw new IllegalArgumentException(sm.getString("servletRegistration.iae")); } wrapper.setRunAs(roleName); }
public Set<String> setServletSecurity(ServletSecurityElement servletSecurity) { if (!((Context) wrapper.getParent()).isStarting()) { throw new IllegalStateException(sm.getString ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath())); } if (servletSecurity == null) { throw new IllegalArgumentException(sm.getString("servletRegistration.iae")); } return wrapper.setServletSecurity(servletSecurity); }
public void setLoadOnStartup(int loadOnStartup) { if (!((Context) wrapper.getParent()).isStarting()) { throw new IllegalStateException(sm.getString ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath())); } wrapper.setLoadOnStartup(loadOnStartup); }
public void setAsyncSupported(boolean asyncSupported) { if (!((Context) wrapper.getParent()).isStarting()) { throw new IllegalStateException(sm.getString ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath())); } wrapper.setAsyncSupported(asyncSupported); }
public boolean setInitParameter(String name, String value) { if (!context.isStarting()) { throw new IllegalStateException(sm.getString("filterRegistration.ise", context.getPath())); } if (name == null || value == null) { throw new IllegalArgumentException(sm.getString("filterRegistration.iae")); } if (filterDef.getInitParameter(name) != null) { return false; } filterDef.addInitParameter(name, value); context.addFilterDef(filterDef); return true; }
public void setAsyncSupported(boolean asyncSupported) { if (!context.isStarting()) { throw MESSAGES.cannotAddFilterRegistrationAfterInit(context.getPath()); } filterDef.setAsyncSupported(asyncSupported); context.addFilterDef(filterDef); }
public boolean setInitParameter(String name, String value) { if (!((Context) wrapper.getParent()).isStarting()) { throw new IllegalStateException(sm.getString ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath())); } if (name == null || value == null) { throw new IllegalArgumentException(sm.getString("servletRegistration.iae")); } if (wrapper.findInitParameter(name) == null) { wrapper.addInitParameter(name, value); return true; } else { return false; } }
public Set<String> addMapping(String... urlPatterns) { Set<String> conflicts = new HashSet<String>(); if (!((Context) wrapper.getParent()).isStarting()) { throw new IllegalStateException(sm.getString ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath())); } if (urlPatterns == null || urlPatterns.length == 0) { throw new IllegalArgumentException(sm.getString("servletRegistration.iae")); } for (String urlPattern : urlPatterns) { if (((Context) wrapper.getParent()).findServletMapping(urlPattern) != null) { conflicts.add(urlPattern); } } if (conflicts.isEmpty()) { for (String urlPattern : urlPatterns) { ((Context) wrapper.getParent()).addServletMapping(urlPattern, wrapper.getName()); } } return conflicts; }
public void setLoadOnStartup(int loadOnStartup) { if (!((Context) wrapper.getParent()).isStarting()) { throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath()); } wrapper.setLoadOnStartup(loadOnStartup); }
public void setAsyncSupported(boolean asyncSupported) { if (!((Context) wrapper.getParent()).isStarting()) { throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath()); } wrapper.setAsyncSupported(asyncSupported); }
public Set<String> setServletSecurity(ServletSecurityElement servletSecurity) { if (!((Context) wrapper.getParent()).isStarting()) { throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath()); } if (servletSecurity == null) { throw MESSAGES.invalidServletRegistrationArguments(); } return wrapper.setServletSecurity(servletSecurity); }
public void setRunAsRole(String roleName) { if (!((Context) wrapper.getParent()).isStarting()) { throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath()); } if (roleName == null) { throw MESSAGES.invalidServletRegistrationArguments(); } wrapper.setRunAs(roleName); }
public boolean setInitParameter(String name, String value) { if (!context.isStarting()) { throw MESSAGES.cannotAddFilterRegistrationAfterInit(context.getPath()); } if (name == null || value == null) { throw MESSAGES.invalidFilterRegistrationArguments(); } if (filterDef.getInitParameter(name) != null) { return false; } filterDef.addInitParameter(name, value); context.addFilterDef(filterDef); return true; }
public boolean setInitParameter(String name, String value) { if (!((Context) wrapper.getParent()).isStarting()) { throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath()); } if (name == null || value == null) { throw MESSAGES.invalidServletRegistrationArguments(); } if (wrapper.findInitParameter(name) == null) { wrapper.addInitParameter(name, value); return true; } else { return false; } }
public boolean addMappingForUrlPatterns( EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String... urlPatterns) { if (!context.isStarting()) { throw new IllegalStateException(sm.getString("filterRegistration.ise", context.getPath())); } if (urlPatterns == null || urlPatterns.length == 0) { throw new IllegalArgumentException(sm.getString("filterRegistration.iae")); } FilterMap filterMap = new FilterMap(); for (String urlPattern : urlPatterns) { filterMap.addURLPattern(urlPattern); } filterMap.setFilterName(filterDef.getFilterName()); if (dispatcherTypes != null) { for (DispatcherType dispatcherType: dispatcherTypes) { filterMap.setDispatcher(dispatcherType.name()); } } if (isMatchAfter) { context.addFilterMap(filterMap); } else { context.addFilterMapBefore(filterMap); } return true; }
public void setMultipartConfig(MultipartConfigElement multipartConfig) { if (!((Context) wrapper.getParent()).isStarting()) { throw new IllegalStateException(sm.getString ("servletRegistration.ise", ((Context) wrapper.getParent()).getPath())); } if (multipartConfig == null) { throw new IllegalArgumentException(sm.getString("servletRegistration.iae")); } Multipart multipart = new Multipart(); multipart.setLocation(multipartConfig.getLocation()); multipart.setMaxFileSize(multipartConfig.getMaxFileSize()); multipart.setMaxRequestSize(multipartConfig.getMaxRequestSize()); multipart.setFileSizeThreshold(multipartConfig.getFileSizeThreshold()); wrapper.setMultipartConfig(multipart); }
public void setMultipartConfig(MultipartConfigElement multipartConfig) { if (!((Context) wrapper.getParent()).isStarting()) { throw MESSAGES.cannotAddServletRegistrationAfterInit(((Context) wrapper.getParent()).getPath()); } if (multipartConfig == null) { throw MESSAGES.invalidServletRegistrationArguments(); } Multipart multipart = new Multipart(); multipart.setLocation(multipartConfig.getLocation()); multipart.setMaxFileSize(multipartConfig.getMaxFileSize()); multipart.setMaxRequestSize(multipartConfig.getMaxRequestSize()); multipart.setFileSizeThreshold(multipartConfig.getFileSizeThreshold()); wrapper.setMultipartConfig(multipart); }