}
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
HttpServerAdapter adapter = getTransport().httpServerAdapter();
JettyHttpServerRestRequest restRequest = new JettyHttpServerRestRequest(request);
JettyHttpServerRestChannel restChannel = new JettyHttpServerRestChannel(restRequest, response);
try {
adapter.dispatchRequest(restRequest, restChannel);
restChannel.await();
} catch (InterruptedException e) {
throw new ServletException("failed to dispatch request", e);
} catch (Exception e) {
throw new IOException("failed to dispatch request", e);
}
if (restChannel.sendFailure() != null) {
throw restChannel.sendFailure();
}
}