Akka.system().scheduler().scheduleOnce(
Duration.create(0, TimeUnit.MILLISECONDS),
new Runnable() {
public void run() {
Logger.info("ON START --- " + System.currentTimeMillis());
}
},
Akka.system().dispatcher()
);
Akka.system().scheduler().schedule(
Duration.create(nextExecutionInSeconds(8, 0), TimeUnit.SECONDS),
Duration.create(24, TimeUnit.HOURS),
new Runnable() {
@Override
public void run() {
Logger.info("EVERY DAY AT 8:00 --- " + System.currentTimeMillis());
}
},
Akka.system().dispatcher()
);
Akka.system().scheduler().schedule(
Duration.create(0, TimeUnit.MILLISECONDS),
Duration.create(60, TimeUnit.SECONDS),
new Runnable() {
@Override
public void run() {
Logger.info("creating the runnable");
Logger.info("EVERY 60 MInutes --- " + System.currentTimeMillis());
executeAllMongoAggregations();
}
},
Akka.system().dispatcher()
);
} Akka.system().scheduler().scheduleOnce(
Duration.create(0, TimeUnit.MILLISECONDS),
new Runnable() {
public void run() {
Logger.info("ON START --- " + System.currentTimeMillis());
}
},
Akka.system().dispatcher()
);
Akka.system().scheduler().schedule(
Duration.create(nextExecutionInSeconds(8, 0), TimeUnit.SECONDS),
Duration.create(24, TimeUnit.HOURS),
new Runnable() {
@Override
public void run() {
Logger.info("EVERY DAY AT 8:00 --- " + System.currentTimeMillis());
}
},
Akka.system().dispatcher()
);
Akka.system().scheduler().schedule(
Duration.create(0, TimeUnit.MILLISECONDS),
Duration.create(60, TimeUnit.SECONDS),
new Runnable() {
@Override
public void run() {
Logger.info("creating the runnable");
Logger.info("EVERY 60 MInutes --- " + System.currentTimeMillis());
}
},
Akka.system().dispatcher()
);
}