org.jboss.dashboard.scheduler
Class Scheduler
java.lang.Object
org.jboss.dashboard.scheduler.Scheduler
@ApplicationScoped
@Named(value="scheduler")
public class Scheduler
- extends Object
Task scheduler component. Implementation details:
- It uses internally an instance of java.util.concurrent.ScheduledThreadPoolExecutor
which provides a thread pool and the delayed task execution capability.
- Fully transactional. Because it's integrated with the Hibernate transaction manager. So all the scheduler
operations are committed only if the underlying transaction completes successfully.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
executor
protected PausableThreadPoolExecutor executor
threadFactory
protected ThreadFactory threadFactory
scheduledTasks
protected Map<Object,SchedulerTask> scheduledTasks
maxThreadPoolSize
@Inject
protected int maxThreadPoolSize
runOnStart
@Inject
protected boolean runOnStart
Scheduler
public Scheduler()
lookup
public static Scheduler lookup()
- Get the scheduler instance.
init
@PostConstruct
public void init()
shutdown
@PreDestroy
public void shutdown()
isRunOnStart
public boolean isRunOnStart()
setRunOnStart
public void setRunOnStart(boolean runOnStart)
getMaxThreadPoolSize
public int getMaxThreadPoolSize()
setMaxThreadPoolSize
public void setMaxThreadPoolSize(int maxThreadPoolSize)
getThreadPoolSize
public int getThreadPoolSize()
getThreadFactory
public ThreadFactory getThreadFactory()
setThreadFactory
public void setThreadFactory(ThreadFactory threadFactory)
getNumberOfScheduledTasks
public int getNumberOfScheduledTasks()
getNumberOfScheduledTasksInQueue
public int getNumberOfScheduledTasksInQueue()
getScheduledTasks
public List<SchedulerTask> getScheduledTasks()
getRunningTasks
public List<SchedulerTask> getRunningTasks()
getMisfiredTasks
public List<SchedulerTask> getMisfiredTasks()
getWaitingTasks
public List<SchedulerTask> getWaitingTasks()
pause
public void pause()
resume
public void resume()
isPaused
public boolean isPaused()
execute
public void execute(SchedulerTask task)
schedule
public void schedule(SchedulerTask task,
Date date)
schedule
public void schedule(SchedulerTask task,
long seconds)
execute
public void execute(SchedulerTask task,
boolean onlyIfCommit)
schedule
public void schedule(SchedulerTask task,
Date date,
boolean onlyIfCommit)
schedule
public void schedule(SchedulerTask task,
long seconds,
boolean onlyIfCommit)
unschedule
public void unschedule(String key)
unscheduleAll
public void unscheduleAll()
fireTask
public void fireTask(String key)
_schedule
protected void _schedule(SchedulerTask task,
Date date)
_schedule
protected void _schedule(SchedulerTask task,
long seconds)
_unschedule
protected void _unschedule(String key)
_unscheduleAll
public void _unscheduleAll()
_purge
protected void _purge()
printScheduledTasksReport
public String printScheduledTasksReport()
Copyright © 2012-2014 JBoss by Red Hat. All Rights Reserved.