Here you can find the source of runRotateKeys()
public static void runRotateKeys()
//package com.java2s; //License from project: Open Source License import java.util.Timer; import java.util.TimerTask; public class Main { public static void runRotateKeys() { Timer timer = new Timer(); timer.schedule(new TimerTask() { @Override//w w w .j a va2 s.co m public void run() { System.out.println("Rotating keys..."); } }, 2 * 60 * 1000, 2 * 60 * 1000); // (delay,period) 7*24*60*60*1000 For 7 days } }