use of org.jboss.as.ee.component.interceptors.OrderedItemContainer in project wildfly by wildfly.
the class ComponentConfiguration method addTimeoutViewInterceptor.
/**
* Adds a timeout interceptor factory to every method on the component.
*
* @param factory The interceptor factory to add
* @param priority The interceptors relative order
*/
public void addTimeoutViewInterceptor(InterceptorFactory factory, int priority) {
for (Method method : (Iterable<Method>) classIndex.getClassMethods()) {
OrderedItemContainer<InterceptorFactory> interceptors = timeoutInterceptors.get(method);
if (interceptors == null) {
timeoutInterceptors.put(method, interceptors = new OrderedItemContainer<InterceptorFactory>());
}
interceptors.add(factory, priority);
}
}
use of org.jboss.as.ee.component.interceptors.OrderedItemContainer in project wildfly by wildfly.
the class ComponentConfiguration method addComponentInterceptors.
/**
* Adds an interceptor factory to every method on the component.
*
* @param factory The interceptor factory to add
* @param priority The interceptors relative order
* @param publicOnly If true then then interceptor is only added to public methods
*/
public void addComponentInterceptors(List<InterceptorFactory> factory, int priority, boolean publicOnly) {
for (Method method : (Iterable<Method>) classIndex.getClassMethods()) {
if (publicOnly && !Modifier.isPublic(method.getModifiers())) {
continue;
}
OrderedItemContainer<List<InterceptorFactory>> interceptors = componentInterceptors.get(method);
if (interceptors == null) {
componentInterceptors.put(method, interceptors = new OrderedItemContainer<List<InterceptorFactory>>());
}
interceptors.add(factory, priority);
}
}
Aggregations