requestConns.countDown();
}
};
EventListener serverEventListener = new SimpleEventListener() {
@Override
public void connectionOpen(NHttpConnection conn) {
openServerConns.incrementAndGet();
super.connectionOpen(conn);
}
@Override
public void connectionClosed(NHttpConnection conn) {
closedServerConns.incrementAndGet();
super.connectionClosed(conn);
}
};
HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
new ResponseDate(),
new ResponseServer(),
new ResponseContent(),
new ResponseConnControl()
});
BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
serverHttpProc,
new DefaultHttpResponseFactory(),
new DefaultConnectionReuseStrategy(),
this.server.getParams());
serviceHandler.setHandlerResolver(
new SimpleHttpRequestHandlerResolver(requestHandler));
serviceHandler.setEventListener(
serverEventListener);
EventListener clientEventListener = new SimpleEventListener() {
@Override
public void connectionOpen(NHttpConnection conn) {
openClientConns.incrementAndGet();
super.connectionOpen(conn);