Search in sources :

Example 1 with Scheduler

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();
}
Also used : Scheduler(it.sauronsoftware.cron4j.Scheduler)

Example 2 with Scheduler

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();
}
Also used : DBHelper(h2weibo.model.DBHelper) Scheduler(it.sauronsoftware.cron4j.Scheduler) JedisPool(redis.clients.jedis.JedisPool)

Aggregations

Scheduler (it.sauronsoftware.cron4j.Scheduler)2 DBHelper (h2weibo.model.DBHelper)1 JedisPool (redis.clients.jedis.JedisPool)1