Ejemplo n.º 1
0
  private void stopEventHandlerThread() {
    if (evt_thread != null) {
      event_queue.close(false);
      event_queue = null;
      evt_thread = null;
      return;
    }

    if (event_queue != null) {
      event_queue.close(false);
      event_queue = null;
    }
  }
Ejemplo n.º 2
0
 /**
  * Waits until the current requests in the queue have been processed, then clears the queue and
  * discards new requests from now on
  */
 public synchronized void suspend() {
   if (!suspended) {
     suspended = true;
     queue.clear();
     waitUntilCompleted(MAX_COMPLETION_TIME);
     queue.close(true);
     resumer =
         timer.schedule(
             new Runnable() {
               public void run() {
                 resume();
               }
             },
             resume_task_timeout,
             TimeUnit.MILLISECONDS);
   }
 }
Ejemplo n.º 3
0
 synchronized void stop(boolean flush) {
   queue.close(flush);
   if (resumer != null) resumer.cancel(false);
 }