ResponseHandler implements IResponseHandler { public void onResponse(IHttpResponse response) throws IOException { status = response.getStatus(); ... } public void void onException(IOException ioe) { ... } }
654655656657658659660661662663664
public void onRequest(final IHttpExchange exchange) throws IOException { countOnRequestCalled++; onRequestThreadname = Thread.currentThread().getName(); IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
692693694695696697698699700701702
726727728729730731732733734735736
public void onRequest(final IHttpExchange exchange) throws IOException { this.request = exchange.getRequest(); this.onRequestThreadname = Thread.currentThread().getName(); IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
758759760761762763764765766767768
@InvokeOn(InvokeOn.MESSAGE_RECEIVED) public void onRequest(final IHttpExchange exchange) throws IOException { this.request = exchange.getRequest(); this.onRequestThreadname = Thread.currentThread().getName(); IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
789790791792793794795796797798799
private boolean onResponseCalled = false; public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { onResponseCalled = true; exchange.send(response); }
7475767778798081828384
public void onRequest(final IHttpExchange exchange) throws IOException { PostRequest newRequest = new PostRequest(exchange.getRequest().getRequestUrl().toString(), "text/plain", "Hello"); IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
136137138139140141142143144145146
IHttpRequestHandler filter = new IHttpRequestHandler() { public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { exchange.send(response); }
192193194195196197198199200201202
IHttpRequestHandler filter = new IHttpRequestHandler() { public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { HttpResponse newResponse = new HttpResponse(200, "text/plain", "Hello You"); exchange.send(newResponse);
252253254255256257258259260261262
IHttpRequestHandler filter = new IHttpRequestHandler() { public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { BodyDataSink bodyDataSink = exchange.send(new HttpResponseHeader(200, "text/plain")); bodyDataSink.write("Hello");
324325326327328329330331332333334
IHttpRequestHandler filter = new IHttpRequestHandler() { public void onRequest(final IHttpExchange exchange) throws IOException { IHttpResponseHandler respHdl = new IHttpResponseHandler() { public void onResponse(IHttpResponse response) throws IOException { BodyDataSink bodyDataSink = exchange.send(new HttpResponseHeader(200, "text/plain"), 9); bodyDataSink.write("Hello");