Code example for ScheduledFuture

Methods: cancel

0
  } 
 
  private void cancel()  
  { 
    if (inactivityFuture != null) {
      inactivityFuture.cancel(true);
      inactivityFuture = null;
    } 
  } 
 
  void shutdown()  
  { 
    cancel(); 
    inactivityTimer.shutdown();
  } 
 
  private static final class DaemonThreadFactory implements ThreadFactory 
  { 
    public Thread newThread(Runnable runnable) 
    { 
      Thread thread = new Thread(runnable);