public class TaskScheduler extends Object
| Modifier and Type | Class and Description |
|---|---|
private class |
TaskScheduler.VoidTaskEntry |
class |
TaskScheduler.Worker |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
dynamicWorkerCount |
protected Logger |
logger |
protected int |
maxThreads |
protected String |
name |
private static TaskScheduler |
RUNTIME_SCHEDULER |
protected long |
sleepThreadSwitch |
protected Deque<TaskEntry<?>> |
taskEntries |
protected ThreadGroup |
threadGroup |
protected AtomicLong |
threadId |
protected long |
threadLiveMillis |
protected Collection<TaskScheduler.Worker> |
workers |
| Constructor and Description |
|---|
TaskScheduler() |
TaskScheduler(Collection<TaskEntry<?>> entries) |
TaskScheduler(Collection<TaskEntry<?>> entries,
Logger logger) |
TaskScheduler(Collection<TaskEntry<?>> entries,
Logger logger,
long sleepThreadSwtich) |
TaskScheduler(Collection<TaskEntry<?>> entries,
long sleepThreadSwtich) |
TaskScheduler(int maxThreads) |
TaskScheduler(int maxThreads,
boolean dynamicWorkerCount) |
TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries) |
TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
Logger logger) |
TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
Logger logger,
boolean dynamicWorkerCount) |
TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
Logger logger,
long sleepThreadSwitch) |
TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
Logger logger,
long sleepThreadSwitch,
boolean dynamicThreadCount) |
TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
Logger logger,
long sleepThreadSwitch,
boolean dynamicThreadCount,
long threadLiveMillis) |
TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
long sleepThreadSwitch) |
TaskScheduler(int maxThreads,
Logger logger) |
TaskScheduler(int maxThreads,
Logger logger,
boolean dynamicWorkerCount) |
TaskScheduler(int maxThreads,
Logger logger,
long sleepThreadSwitch) |
TaskScheduler(int maxThreads,
long sleepThreadSwitch) |
TaskScheduler(Logger logger) |
TaskScheduler(Logger logger,
long sleepThreadSwitch) |
TaskScheduler(long sleepThreadSwitch) |
private static final TaskScheduler RUNTIME_SCHEDULER
protected final ThreadGroup threadGroup
protected final AtomicLong threadId
protected final String name
protected final long sleepThreadSwitch
protected final boolean dynamicWorkerCount
protected final long threadLiveMillis
protected int maxThreads
protected Logger logger
protected Collection<TaskScheduler.Worker> workers
public TaskScheduler()
public TaskScheduler(int maxThreads)
public TaskScheduler(int maxThreads,
Logger logger)
public TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
Logger logger)
public TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
Logger logger,
long sleepThreadSwitch)
public TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
Logger logger,
long sleepThreadSwitch,
boolean dynamicThreadCount)
public TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
Logger logger,
long sleepThreadSwitch,
boolean dynamicThreadCount,
long threadLiveMillis)
public TaskScheduler(long sleepThreadSwitch)
public TaskScheduler(int maxThreads,
long sleepThreadSwitch)
public TaskScheduler(int maxThreads,
Logger logger,
long sleepThreadSwitch)
public TaskScheduler(Logger logger)
public TaskScheduler(Logger logger, long sleepThreadSwitch)
public TaskScheduler(Collection<TaskEntry<?>> entries)
public TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries)
public TaskScheduler(Collection<TaskEntry<?>> entries, long sleepThreadSwtich)
public TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
long sleepThreadSwitch)
public TaskScheduler(Collection<TaskEntry<?>> entries, Logger logger)
public TaskScheduler(Collection<TaskEntry<?>> entries, Logger logger, long sleepThreadSwtich)
public TaskScheduler(int maxThreads,
boolean dynamicWorkerCount)
public TaskScheduler(int maxThreads,
Logger logger,
boolean dynamicWorkerCount)
public TaskScheduler(int maxThreads,
Collection<TaskEntry<?>> entries,
Logger logger,
boolean dynamicWorkerCount)
public static TaskScheduler runtimeScheduler()
public TaskEntryFuture<Void> schedule(Runnable runnable)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, long delay)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, long delay, long repeats)
public <V> TaskEntryFuture<V> schedule(TaskEntry<V> taskEntry)
private <V> TaskEntryFuture<V> offerEntry(TaskEntry<V> entry)
private void checkEnougthThreads()
private TaskScheduler.Worker hasFreeWorker()
public int getCurrentThreadSize()
public int getMaxThreads()
protected void newWorker()
public TaskEntryFuture<Void> schedule(Runnable runnable, Date timeout)
public TaskEntryFuture<Void> schedule(Runnable runnable, long delay)
public TaskEntryFuture<Void> schedule(Runnable runnable, LocalDate localDate, LocalTime localTime)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, LocalDate localDate, LocalTime localTime)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, LocalDate localDate, LocalTime localTime, long repeats)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, LocalDateTime localDateTime, long repeats)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, ZonedDateTime zonedDateTime, long repeats)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, Instant instant, long repeats)
public TaskEntryFuture<Void> schedule(Runnable runnable, LocalDateTime localDateTime)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, LocalDateTime localDateTime)
public TaskEntryFuture<Void> schedule(Runnable runnable, ZonedDateTime zonedDateTime)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, ZonedDateTime zonedDateTime)
public TaskEntryFuture<Void> schedule(Runnable runnable, Instant instant)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, Instant instant)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, Date timeout)
public TaskEntryFuture<Void> schedule(Runnable runnable, long delay, TimeUnit timeUnit)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, long delay, TimeUnit timeUnit)
public TaskEntryFuture<Void> schedule(Runnable runnable, Date timeout, long repeats)
public TaskEntryFuture<Void> schedule(Runnable runnable, long delay, long repeats)
public TaskEntryFuture<Void> schedule(Runnable runnable, long delay, TimeUnit timeUnit, long repeats)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, Date timeout, long repeats)
public TaskEntryFuture<Void> schedule(Runnable runnable, Callback<Void> callback, long delay, TimeUnit timeUnit, long repeats)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, long delay)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, long delay, long repeats)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, LocalDate localDate, LocalTime localTime)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, LocalDate localDate, LocalTime localTime)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, LocalDate localDate, LocalTime localTime, long repeats)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, LocalDateTime localDateTime, long repeats)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, ZonedDateTime zonedDateTime, long repeats)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, Instant instant, long repeats)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, LocalDateTime localDateTime)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, LocalDateTime localDateTime)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, ZonedDateTime zonedDateTime)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, ZonedDateTime zonedDateTime)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Instant instant)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, Instant instant)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, long delay)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, long delay, TimeUnit timeUnit)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, long delay, TimeUnit timeUnit)
public <V> TaskEntryFuture<V> schedule(Callable<V> callable, Callback<V> callback, long delay, TimeUnit timeUnit, long repeats)
public <V> Collection<TaskEntryFuture<V>> schedule(Collection<TaskEntry<V>> threadEntries)
public Collection<TaskEntry<?>> shutdown()
public TaskScheduler chargeThreadLimit(short threads)
public ThreadGroup getThreadGroup()
public String getName()
public Logger getLogger()
public void setLogger(Logger logger)
Copyright © 2020. All rights reserved.