Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
protected boolean |
dispatcherActive |
protected long |
dispatcherSleepTime |
protected int |
maxAliveThreads |
protected static int |
tcount
used to give threads unique names
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
Dispatcher(boolean isDaemon,
int priority,
boolean autoStart)
construct a thread in the default ThreadGroup with a few options set
|
Dispatcher(ThreadGroup tg,
boolean isDaemon,
int priority,
boolean autoStart)
construct a thread in the default ThreadGroup with a few options set
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCall(DownloadThread call)
Add an object to the queue of threads to run
|
long |
getDispatcherSleepTime() |
int |
getMaxAliveThreads() |
int |
getNumOfActiveCalls() |
List |
getQueue() |
boolean |
isDispatcherActive() |
void |
run()
start going.
|
void |
setDispatcherActive(boolean dispatcherActive) |
void |
setDispatcherSleepTime(long dispatcherSleepTime) |
void |
setMaxAliveThreads(int maxAliveThreads) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprotected boolean dispatcherActive
protected static int tcount
protected long dispatcherSleepTime
protected int maxAliveThreads
public Dispatcher(boolean isDaemon,
int priority,
boolean autoStart)
isDaemon - true means be a daemon thread,
false means don't.priority - the value to use when calling setPriorityautoStart - true means call this.start()Thread.start()public Dispatcher(ThreadGroup tg, boolean isDaemon, int priority, boolean autoStart)
tg - the ThreadGroup to be inisDaemon - true means be a daemon thread,
false means don't.priority - the value to use when calling setPriorityautoStart - true means call this.start()Thread.start()public void addCall(DownloadThread call)
call - the object to addpublic void run()
public int getNumOfActiveCalls()
public boolean isDispatcherActive()
public void setDispatcherActive(boolean dispatcherActive)
public long getDispatcherSleepTime()
public void setDispatcherSleepTime(long dispatcherSleepTime)
public void setMaxAliveThreads(int maxAliveThreads)
public int getMaxAliveThreads()
public List getQueue()
Copyright © 2016. All rights reserved.