use of com.predic8.membrane.core.rules.ServiceProxy in project service-proxy by membrane.
the class BoundConnectionTest method setUp.
@Before
public void setUp() throws Exception {
router = new HttpRouter();
ServiceProxy sp1 = new ServiceProxy(new ServiceProxyKey("*", "*", ".*", 3021), "localhost", 3022);
router.getRuleManager().addProxyAndOpenPortIfNew(sp1);
ServiceProxy sp2 = new ServiceProxy(new ServiceProxyKey("*", "*", ".*", 3022), "", -1);
sp2.getInterceptors().add(new AbstractInterceptor() {
@Override
public Outcome handleRequest(Exchange exc) throws Exception {
exc.getRequest().readBody();
exc.setResponse(Response.ok("OK.").build());
connectionHash = ((HttpServerHandler) exc.getHandler()).getSrcOut().hashCode();
return Outcome.RETURN;
}
});
router.getRuleManager().addProxyAndOpenPortIfNew(sp2);
router.init();
}
use of com.predic8.membrane.core.rules.ServiceProxy in project service-proxy by membrane.
the class AccessControlInterceptorIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
Rule rule = new ServiceProxy(new ServiceProxyKey("localhost", "POST", ".*", 3008), "thomas-bayer.com", 80);
router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(rule);
}
use of com.predic8.membrane.core.rules.ServiceProxy in project service-proxy by membrane.
the class MultipleLoadBalancersTest method createBalancingInterceptor.
private LoadBalancingInterceptor createBalancingInterceptor(int port, String name) throws Exception {
ServiceProxy sp3 = new ServiceProxy(new ServiceProxyKey("localhost", "POST", ".*", port), "thomas-bayer.com", 80);
LoadBalancingInterceptor balancingInterceptor1 = new LoadBalancingInterceptor();
balancingInterceptor1.setName(name);
sp3.getInterceptors().add(balancingInterceptor1);
balancer.getRuleManager().addProxyAndOpenPortIfNew(sp3);
balancer.init();
return balancingInterceptor1;
}
use of com.predic8.membrane.core.rules.ServiceProxy in project service-proxy by membrane.
the class WSDLPublisherTest method before.
@Before
public void before() throws Exception {
router = new HttpRouter();
ServiceProxy sp2 = new ServiceProxy(new ServiceProxyKey("*", "*", ".*", port), "", -1);
WSDLPublisherInterceptor wi = new WSDLPublisherInterceptor();
wi.setWsdl(wsdlLocation);
wi.init(router);
sp2.getInterceptors().add(wi);
router.getRuleManager().addProxyAndOpenPortIfNew(sp2);
router.init();
}
use of com.predic8.membrane.core.rules.ServiceProxy in project service-proxy by membrane.
the class ServiceInvocationTest method createFirstRule.
private ServiceProxy createFirstRule() {
ServiceProxy rule = new ServiceProxy(new ServiceProxyKey("localhost", Request.METHOD_POST, "*", 3016), "thomas-bayer.com", 80);
rule.setTargetURL("service:log");
rule.getInterceptors().add(new MockInterceptor("process"));
return rule;
}
Aggregations