Search in sources :

Example 1 with Task

use of org.exoplatform.services.scheduler.Task in project kernel by exoplatform.

the class QueueTaskJob method execute.

public void execute(JobContext context) throws Exception {
    PortalContainer manager = PortalContainer.getInstance();
    QueueTasks qtasks = (QueueTasks) manager.getComponentInstanceOfType(QueueTasks.class);
    Task task = qtasks.poll();
    while (task != null) {
        try {
            task.execute();
        } catch (Exception ex) {
            LOG.error(ex.getLocalizedMessage(), ex);
        }
        task = qtasks.poll();
    }
}
Also used : Task(org.exoplatform.services.scheduler.Task) QueueTasks(org.exoplatform.services.scheduler.QueueTasks) PortalContainer(org.exoplatform.container.PortalContainer)

Aggregations

PortalContainer (org.exoplatform.container.PortalContainer)1 QueueTasks (org.exoplatform.services.scheduler.QueueTasks)1 Task (org.exoplatform.services.scheduler.Task)1