Java Timer Usage delayedExit(final int status, final long delay)

Here you can find the source of delayedExit(final int status, final long delay)

Description

delayed Exit

License

Open Source License

Declaration

public static Timer delayedExit(final int status, final long delay) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Timer;
import java.util.TimerTask;

public class Main {
    public static Timer delayedExit(final int status, final long delay) {
        // Start kill timer. If we don't get a key inject or terminate request before 5 mins, kill application
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            public void run() {
                //         Log.d( TAG, "Forcing exit("+status+")!");
                System.exit(0);/* w  ww . jav  a  2 s .c  o m*/
            }
        }, delay);
        return timer;
    }
}

Related

  1. countWorkerPoolTimerThreads()
  2. exitSystemAfterTimeout(final long delay)
  3. getMinIdleTimer()
  4. getQuickSearchTimer()
  5. getSlowTimer()