{
if (! isInitializing())
throw new IllegalStateException();
try {
FilterConfigImpl config = new FilterConfigImpl();
config.setWebApp(this);
config.setServletContext(this);
config.setFilterName(filterName);
config.setFilterClass(className);
if (filterClass != null)
config.setFilterClass(filterClass);
if (filter != null)
config.setFilter(filter);
addFilter(config);
return config;
}