colesico.framework.service.InterceptorsChain Maven / Gradle / Ivy
package colesico.framework.service;
import java.util.ArrayDeque;
import java.util.Queue;
/**
*
*/
public final class InterceptorsChain {
private Queue queue = new ArrayDeque();
public void add(Interceptor interceptor, P parameters) {
queue.add(new Interception(interceptor, parameters));
}
public Interception next() {
return queue.poll();
}
public static final class Interception {
private final Interceptor interceptor;
private final P parameters;
public Interception(Interceptor interceptor, P parameters) {
this.interceptor = interceptor;
this.parameters = parameters;
}
public Interceptor getInterceptor() {
return interceptor;
}
public P getParameters() {
return parameters;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy