@Override
 public void onError(AsyncEvent event) throws IOException {
   ServletResponse resp = event.getAsyncContext().getResponse();
   resp.getWriter().write("onError-");
   resp.flushBuffer();
   if (completeOnError) {
     event.getAsyncContext().complete();
   }
 }
 @Override
 public void onTimeout(AsyncEvent event) throws IOException {
   ServletResponse resp = event.getAsyncContext().getResponse();
   resp.getWriter().write("onTimeout-");
   resp.flushBuffer();
   if (completeOnTimeout) {
     if (dispatchUrl == null) {
       event.getAsyncContext().complete();
     } else {
       event.getAsyncContext().dispatch(dispatchUrl);
     }
   }
 }
 @Override
 public void onError(AsyncEvent event) throws IOException {
   HttpServletResponse response = (HttpServletResponse) event.getSuppliedResponse();
   response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR_500);
   event.getAsyncContext().complete();
   latch.countDown();
 }
 @Override
 public void onTimeout(AsyncEvent event) throws IOException {
   // Remove before it's redispatched, so it won't be
   // redispatched again at the end of the filtering.
   AsyncContext asyncContext = event.getAsyncContext();
   _queues[priority].remove(asyncContext);
   asyncContext.dispatch();
 }
 @Override
 public void onComplete(AsyncEvent event) throws IOException {
   if (clients.remove(event.getAsyncContext()) && clientcount.decrementAndGet() == 0) {
     ticker.removeTickListener(this);
   }
 }
 @Override
 public void onTimeout(AsyncEvent event) throws IOException {
   event.getAsyncContext().complete();
 }
 @Override
 public void onStartAsync(AsyncEvent event) throws IOException {
   ServletResponse resp = event.getAsyncContext().getResponse();
   resp.getWriter().write("onStartAsync-");
   resp.flushBuffer();
 }
 @Override
 public void onTimeout(AsyncEvent event) throws IOException {
   _queues[priority].remove(event.getAsyncContext());
   super.onTimeout(event);
 }
 @Override
 public void onTimeout(AsyncEvent event) throws IOException {
   event.getAsyncContext().dispatch();
 }
 @Override
 public void onStartAsync(AsyncEvent event) throws IOException {
   event.getAsyncContext().addListener(this);
 }