use of com.predic8.membrane.core.interceptor.DispatchingInterceptor in project service-proxy by membrane.
the class HttpRouter method createTransport.
/**
* Same as the default config from monitor-beans.xml
*/
private Transport createTransport(ProxyConfiguration proxyConfiguration) {
Transport transport = new HttpTransport();
List<Interceptor> interceptors = new ArrayList<Interceptor>();
interceptors.add(new RuleMatchingInterceptor());
interceptors.add(new DispatchingInterceptor());
interceptors.add(new UserFeatureInterceptor());
HTTPClientInterceptor httpClientInterceptor = new HTTPClientInterceptor();
interceptors.add(httpClientInterceptor);
transport.setInterceptors(interceptors);
return transport;
}
use of com.predic8.membrane.core.interceptor.DispatchingInterceptor in project service-proxy by membrane.
the class Transport method init.
public void init(Router router) throws Exception {
this.router = router;
if (interceptors.isEmpty()) {
interceptors.add(new RuleMatchingInterceptor());
interceptors.add(new ExchangeStoreInterceptor(router.getExchangeStore()));
interceptors.add(new DispatchingInterceptor());
interceptors.add(new ReverseProxyingInterceptor());
interceptors.add(new UserFeatureInterceptor());
interceptors.add(new HTTPClientInterceptor());
}
for (Interceptor interceptor : interceptors) {
interceptor.init(router);
}
}
use of com.predic8.membrane.core.interceptor.DispatchingInterceptor in project service-proxy by membrane.
the class RewriteInterceptorTest method setUp.
@Before
public void setUp() throws Exception {
HttpRouter router = new HttpRouter();
di = new DispatchingInterceptor();
di.init(router);
sp = new ServiceProxy(new ServiceProxyKey(80, null), "www.predic8.de", 80);
sp.init(router);
exc = new Exchange(null);
exc.setRequest(MessageUtil.getGetRequest("/buy/banana/3"));
rewriter = new RewriteInterceptor();
List<Mapping> mappings = new ArrayList<Mapping>();
mappings.add(new Mapping("/buy/(.*)/(.*)", "/buy?item=$1&amount=$2", null));
rewriter.setMappings(mappings);
rewriter.init(router);
}
use of com.predic8.membrane.core.interceptor.DispatchingInterceptor in project service-proxy by membrane.
the class DispatchingInterceptorTest method setUp.
@Before
public void setUp() throws Exception {
dispatcher = new DispatchingInterceptor();
exc = new Exchange(null);
}
Aggregations