serviceHandler.setHandlerResolver(
new SimpleHttpRequestHandlerResolver(new RequestHandler()));
serviceHandler.setExpectationVerifier(
expectationVerifier);
serviceHandler.setEventListener(
new SimpleEventListener());
HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
new RequestContent(),
new RequestTargetHost(),
new RequestConnControl(),
new RequestUserAgent(),
new RequestExpectContinue()});
ThrottlingHttpClientHandler clientHandler = new ThrottlingHttpClientHandler(
clientHttpProc,
requestExecutionHandler,
new DefaultConnectionReuseStrategy(),
this.execService,
this.client.getParams());
clientHandler.setEventListener(
new SimpleEventListener());
this.server.start(serviceHandler);
this.client.start(clientHandler);
ListenerEndpoint endpoint = this.server.getListenerEndpoint();