use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class WsaEndpointRewriterInterceptorTest method setUp.
@Before
public void setUp() {
rewriter = new WsaEndpointRewriterInterceptor();
exc = new Exchange(null);
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class MyInterceptor method handleRequest.
@Override
public Outcome handleRequest(Exchange exc) throws Exception {
System.out.println("MyInterceptor invoked.");
System.out.println("Request headers:");
for (HeaderField headerField : exc.getRequest().getHeader().getAllHeaderFields()) System.out.print(headerField.getHeaderName() + ": " + headerField.getValue());
return Outcome.CONTINUE;
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class LBNotificationClient method notifiyClusterManager.
private Response notifiyClusterManager() throws Exception {
HttpClient client = new HttpClient();
Exchange exc = new Exchange(null);
Request r = MessageUtil.getPostRequest(getRequestURL());
r.setBodyContent(new byte[0]);
exc.setRequest(r);
exc.getDestinations().add(getRequestURL());
Response res = client.call(exc).getResponse();
return res;
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class Exchange method block.
public void block(Message msg) throws TerminateException {
try {
log.debug("Message thread waits");
msg.wait();
log.debug("Message thread received notify");
if (isForcedToStop())
throw new TerminateException("Force the exchange to stop.");
} catch (InterruptedException e1) {
Thread.currentThread().interrupt();
}
}
use of com.predic8.membrane.core.exchange.Exchange in project service-proxy by membrane.
the class DynamicAdminPageInterceptor method handleRequest.
@Override
public Outcome handleRequest(Exchange exc) throws Exception {
log.debug("request: " + exc.getOriginalRequestUri());
exc.setTimeReqSent(System.currentTimeMillis());
Outcome o = dispatchRequest(exc);
exc.setReceived();
exc.setTimeResReceived(System.currentTimeMillis());
return o;
}
Aggregations