Code example for ScheduledThreadPoolExecutor

Methods: scheduleAtFixedRate

0
        } 
        return args;
    } 
 
    private void setupHeartBeater(Reporter reporter) {
        timer = new ScheduledThreadPoolExecutor(1);
        timer.scheduleAtFixedRate(new LauncherMapper(reporter), 0, 30, TimeUnit.SECONDS);
    } 
 
    private void destroyHeartBeater() { 
        timer.shutdownNow();
    } 
 
    private Reporter reporter;
 
    private LauncherMapper(Reporter reporter) {
        this.reporter = reporter;
    } 
 
    public void run() {