* @return linked action chain
* @throws Exception
*/
private Command chain(Iterator configs, Action last) throws Exception {
if (configs.hasNext()) {
FilterConfig config = (FilterConfig)configs.next();
Class clazz = null;
if (config.getName() != null) {
clazz = pluginContext.getFilterClass(config.getName());
if (clazz == null) {
throw new ConfigException("Unknown filter name in '" + config.toInlineString() + "'");
}
} else {
clazz = context.getClassLoader().loadClass(config.getClassName());
}
Filter filter = (Filter)clazz.newInstance();
filter.init(config, context);
return new FilteredCommand(config, filter, chain(configs, last));
} else {