ResponseHandler implements IResponseHandler { public void onResponse(IHttpResponse response) throws IOException { status = response.getStatus(); ... } public void void onException(IOException ioe) { ... } }
323324325326327328329330331332333
try { requestHeader.setAttribute(RETRY_COUNT_KEY, ++countTrials); requestHeader.setAttribute(CookieHandler.COOKIE_WARNING_KEY, false); IHttpResponseHandler respHdl = new IHttpResponseHandler() { @Execution(Execution.NONTHREADED) public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
5758596061626364656667
HttpServer server = new HttpServer(hdl); server.start(); HttpClientConnection con = new HttpClientConnection("localhost", server.getLocalPort()); IHttpResponseHandler resHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { } public void onException(IOException ioe) {
8990919293949596979899
120121122123124125126127128129130
331332333334335336337338339340341
10921093109410951096109710981099110011011102
public void onRequest(final IHttpExchange exchange) throws IOException { httpRequest = exchange.getRequest(); onRequestThreadname = Thread.currentThread().getName(); IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
10681069107010711072107310741075107610771078
360361362363364365366367368369370
try { getRequestHeader().setAttribute(COUNT_REDIRECTS_KEY, incCountRedirect()); getRequestHeader().setAttribute(CookieHandler.COOKIE_WARNING_KEY, false); IHttpResponseHandler respHdl = new IHttpResponseHandler() { @Execution(Execution.NONTHREADED) public void onResponse(IHttpResponse response) throws IOException { getExchange().send(response); }
414415416417418419420421422423424
} try { getRequestHeader().setAttribute(COUNT_REDIRECTS_KEY, incCountRedirect()); getRequestHeader().setAttribute(CookieHandler.COOKIE_WARNING_KEY, false); IHttpResponseHandler respHdl = new IHttpResponseHandler() { @Execution(Execution.NONTHREADED) public void onResponse(IHttpResponse response) throws IOException { getExchange().send(response); }
230231232233234235236237238239240
try { requestHeader.setAttribute(RETRY_COUNT_KEY, ++countTrials); requestHeader.setAttribute(CookieHandler.COOKIE_WARNING_KEY, false); IHttpResponseHandler respHdl = new IHttpResponseHandler() { @Execution(Execution.NONTHREADED) public void onResponse(IHttpResponse response) throws IOException { if (LOG.isLoggable(Level.FINE)) { LOG.fine("forward response");