All Downloads are FREE. Search and download functionalities are using the official Maven repository.

express.filter.FilterLayer Maven / Gradle / Ivy

The newest version!
package express.filter;

import express.http.HttpRequestHandler;
import express.http.request.Request;
import express.http.response.Response;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;

/**
 * @author Simon Reinisch
 * 

* Controller class for FilterLayer. */ public class FilterLayer { private final List filter = Collections.synchronizedList(new ArrayList<>()); public void add(T expressFilter) { this.filter.add(expressFilter); } public void add(int index, T expressFilter) { this.filter.add(index, expressFilter); } public void addAll(List expressFilters) { this.filter.addAll(expressFilters); } public List getFilter() { return filter; } void filter(Request req, Response res) { ListIterator iter = this.filter.listIterator(); while (!res.isClosed() && iter.hasNext()) { iter.next().handle(req, res); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy