use of it.sauronsoftware.cron4j.Scheduler in project ignite by apache.
the class IgniteScheduleProcessor method start.
/** {@inheritDoc} */
@Override
public void start(boolean activeOnStart) throws IgniteCheckedException {
sched = new Scheduler();
sched.start();
}
use of it.sauronsoftware.cron4j.Scheduler in project twitter-2-weibo by rjyo.
the class CommandServlet method init.
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
log.info("Web started.");
JedisPool pool = getPool(getServletContext());
DBHelper helper = DBHelperFactory.createHelper(pool);
// clear the queue
helper.clearQueue();
Scheduler scheduler = new Scheduler();
QueueTask task = new QueueTask();
task.setHelper(DBHelperFactory.createHelper(pool));
scheduler.schedule("*/2 * * * *", task);
scheduler.start();
log.info("Cron scheduler started.");
log.info("Worker started.");
// 1 Threads to handle the sync job
new Thread(new SyncWorkerRunnable(DBHelperFactory.createHelper(pool))).start();
}