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