public class Scheduler<T> extends Object
| 构造器和说明 |
|---|
Scheduler() |
Scheduler(LoggerFactory loggerFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
canRunImmediately(T t,
Runnable task) |
protected Map<T,Queue<Runnable>> |
createStore() |
protected Queue<Runnable> |
createTaskQueue(T t) |
protected void |
dispatch() |
protected void |
disposeDispatcher() |
void |
drop(T t) |
protected boolean |
executeTask(Runnable task) |
protected Runnable |
getRejectedTask() |
protected boolean |
haveReachMaxPendingCount(T t,
Queue<Runnable> queue,
Runnable task) |
protected Runnable |
poll(Queue<Runnable> queue) |
protected void |
prepareChecker(long delay,
long period) |
void |
schedule(T t,
Runnable task) |
protected void |
setRejectedTask(Runnable task) |
void |
setThreadPool(ExecutorService threadPool) |
void |
setUserMaxPendingCount(int max) |
void |
start() |
void |
stop() |
protected void |
stopChecker() |
protected Logger logger
protected int max
protected boolean running
public Scheduler()
public Scheduler(LoggerFactory loggerFactory)
public void setUserMaxPendingCount(int max)
public void setThreadPool(ExecutorService threadPool)
public void start()
public void stop()
throws InterruptedException
public void schedule(T t, Runnable task) throws LinkException
LinkExceptionpublic void drop(T t)
protected boolean haveReachMaxPendingCount(T t, Queue<Runnable> queue, Runnable task)
protected final void dispatch()
protected boolean executeTask(Runnable task)
protected void setRejectedTask(Runnable task)
protected Runnable getRejectedTask()
protected final void disposeDispatcher()
throws InterruptedException
protected final void prepareChecker(long delay,
long period)
protected final void stopChecker()
Copyright © 2020. All rights reserved.