* @param scope ComponentLifecycleScope
*/
public void addMethodInvokerFilter(Class<? extends MethodInvokerFilter> clazz, MethodInvokerFilter instance,
ComponentLifecycleScope scope)
{
FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
descriptor.accept(rdv);
ObjectFactory<FilterDescriptor> factory = new PerRequestObjectFactory<FilterDescriptor>(descriptor);
switch (scope)
{
case PER_REQUEST :
factory = new PerRequestObjectFactory<FilterDescriptor>(descriptor);
break;
case SINGLETON :
if (instance == null)
{
throw new IllegalArgumentException("MethodInvokerFilter instance is null.");
}
factory = new SingletonObjectFactory<FilterDescriptor>(descriptor, instance);
break;
case CONTAINER :
factory = new ContainerObjectFactory<FilterDescriptor>(descriptor);
break;
}
invokerFilters.getList(descriptor.getUriPattern()).add(factory);
}