예제 #1
0
 protected void doFilterChain(
     FilterChain chain, final HttpServletRequest request, final HttpServletResponse response)
     throws IOException, ServletException {
   final Thread thread = Thread.currentThread();
   Runnable requestTimeout =
       new Runnable() {
         @Override
         public void run() {
           closeConnection(request, response, thread);
         }
       };
   Scheduler.Task task =
       _scheduler.schedule(requestTimeout, getMaxRequestMs(), TimeUnit.MILLISECONDS);
   try {
     chain.doFilter(request, response);
   } finally {
     task.cancel();
   }
 }
예제 #2
0
 private void cancelTimeout(Map<String, Object> ctx) {
   Scheduler.Task timeoutTask = (Scheduler.Task) ctx.get(TIMEOUT_FIELD);
   if (timeoutTask != null) {
     timeoutTask.cancel();
   }
 }
예제 #3
0
 private void cancelTask() {
   Scheduler.Task task = this.task;
   if (task != null) task.cancel();
 }
예제 #4
0
 public boolean cancel() {
   org.eclipse.jetty.util.thread.Scheduler.Task task = _task;
   return task != null && task.cancel();
 }