}
// Execute the filter chain method.toString()
List<AjaxFilter> filters = ajaxFilterManager.getAjaxFilters(getName());
final Iterator<AjaxFilter> it = filters.iterator();
AjaxFilterChain chain = new AjaxFilterChain()
{
public Object doFilter(Object obj, Method meth, Object[] params) throws Exception
{
if (it.hasNext())
{
AjaxFilter next = it.next();
return next.doFilter(obj, meth, params, this);
}
else
{
if ((null != obj && meth.getDeclaringClass().equals(obj.getClass())) || Modifier.isStatic(meth.getModifiers()))
{
return meth.invoke(obj, params);
}
else
{
// A proxied method
Method m = obj.getClass().getMethod(meth.getName(), meth.getParameterTypes());
return m.invoke(obj, params);
}
}
}
};
Object reply = chain.doFilter(object, method, parameters);
return reply;
}