public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ClusteredInvocation invocation = newClusteredInvocation(target, baseRequest, request, response); try { invocation.invoke(); } catch (ClusteredInvocationException e) { Throwable cause = e.getCause(); if (cause instanceof HttpException) { throw (HttpException) cause; } else if (cause instanceof IOException) { throw (IOException) cause; } else { throw (IOException) new IOException().initCause(cause); } } }
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ClusteredInvocation invocation = newClusteredInvocation(target, baseRequest, request, response); try { invocation.invoke(); } catch (ClusteredInvocationException e) { Throwable cause = e.getCause(); if (cause instanceof HttpException) { throw (HttpException) cause; } else if (cause instanceof IOException) { throw (IOException) cause; } else { throw (IOException) new IOException().initCause(cause); } } }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { if (null == request) { next.invoke(request, response); return; } ClusteredInvocation invocation = newClusteredInvocation(request, response); try { invocation.invoke(); } catch (ClusteredInvocationException e) { Throwable cause = e.getCause(); if (cause instanceof ServletException) { throw (ServletException) cause; } else if (cause instanceof IOException) { throw (IOException) cause; } else { throw (IOException) new IOException().initCause(e); } } }