|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.ThreadGroup
mandala.util.ThreadPool
mandala.util.SafeThreadPool
Safe threads pool implementation with unlimited maximum bound.
This class extends the generic ThreadPool
implementation which
uses a fixed maximum amount of threads by default which may leads to
deadlock.
ThreadGroup
Nested Class Summary |
Nested classes inherited from class mandala.util.ThreadPool |
ThreadPool.ThreadPoolCancelable |
Field Summary |
Constructor Summary | |
SafeThreadPool()
Creates a new SafeThreadPool instance. |
|
SafeThreadPool(int min)
Creates a new SafeThreadPool instance. |
|
SafeThreadPool(String name)
Creates a new SafeThreadPool instance. |
|
SafeThreadPool(String name,
int min)
Creates a new SafeThreadPool instance. |
|
SafeThreadPool(ThreadGroup parent,
String name,
int min)
Creates a new SafeThreadPool instance. |
|
SafeThreadPool(ThreadGroup parent,
String name,
int min,
int priority,
boolean daemonStatus,
long reactivity)
Creates a new SafeThreadPool instance. |
Methods inherited from class mandala.util.ThreadPool |
cancel, cancel, cancel, delete, execute, finalize, getDaemonStatus, getMax, getMin, getPriority, getReactivity, getSyslog, interrupt, interrupt, isStarted, setSyslog, start |
Methods inherited from class java.lang.ThreadGroup |
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString, uncaughtException |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SafeThreadPool(String name)
Creates a new SafeThreadPool
instance.
Equivalent to SafeThreadPool(name,
DEFAULT_MIN_THREADS_NB)
.
name
- the name of the new thread pool.public SafeThreadPool()
Creates a new SafeThreadPool
instance.
Equivalent to SafeThreadPool(DEFAULT_MIN_THREADS_NB)
.
public SafeThreadPool(int min)
Creates a new SafeThreadPool
instance.
Equivalent to SafeThreadPool(
. where gname
is where gname is a newly
generated name. Automatically generated names are of the form
SafeThreadPool.class.getName() + "#" + n
, where
n
is an integer.
public SafeThreadPool(String name, int min)
Creates a new SafeThreadPool
instance.
Equivalent to
SafeThreadPool(Thread.currentThread().getThreadGroup(), name,
min)
.
public SafeThreadPool(ThreadGroup parent, String name, int min)
Creates a new SafeThreadPool
instance.
Equivalent to SafeThreadPool(parent, name, min,
DEFAULT_PRIORITY, DEFAULT_DAEMON_STATUS,
DEFAULT_REACTIVITY_TIMER)
.
public SafeThreadPool(ThreadGroup parent, String name, int min, int priority, boolean daemonStatus, long reactivity)
Creates a new SafeThreadPool
instance.
The created instance has parent
as parent's thread
group, name
as name and an initial pool of min
threads. It may allocate an unlimited number of threads if needed. The
threads in the pool will be assigned to the given priority
and daemonStatus
. The reactivity
parent
- the parent thread group.name
- the name of the new thread pool.min
- the minimum amount of pre-allocated threads in this thread
pool.priority
- the priority given to daemonStatus
- the daemon status given to reactivity
- the reactivity given to the
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |