|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.utils.StandardThreadFactory
public final class StandardThreadFactory
A customizable implementation of the ThreadFactory. The new
java.util.concurrency library provides a ThreadFactory interface, which is a great
thing, but strangely enough it doesn't provide an customizable implementation.
| Constructor Summary | |
|---|---|
StandardThreadFactory()
Constructs a new StandardThreadFactory with a Thread.NORM_PRIORITY as priority and a newly created ThreadGroup. |
|
StandardThreadFactory(int priority)
Constructs a new StandardThreadFactory with the given priority. |
|
StandardThreadFactory(int priority,
boolean daemon)
|
|
StandardThreadFactory(int priority,
String groupName)
Constructs a new StandardThreadFactory with the given priority and with a newly created ThreadGroup with the given groupname. |
|
StandardThreadFactory(int priority,
ThreadGroup threadGroup)
Constructs a new StandardThreadFactory with the given priority and are part of the give ThreadGroup. |
|
StandardThreadFactory(int priority,
ThreadGroup threadGroup,
boolean daemon)
Constructs a new StandardThreadFactory with the given priority and threadgroup. |
|
StandardThreadFactory(String groupName)
Constructs a new StandardThreadFactory with a Thread.NORM_PRIORITY as priority and with a newly created ThreadGroup with the given groupName. |
|
| Method Summary | |
|---|---|
int |
getPriority()
Returns the priority of created Threads. |
ThreadGroup |
getThreadGroup()
Returns the ThreadGroup of the created Threads. |
boolean |
isProducingDaemons()
Returns true if this StandardThreadFactory is producing deamon threads, false otherwise. |
Thread |
newThread(Runnable runnable)
|
void |
setPriority(int priority)
Sets the priority of the threads. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StandardThreadFactory()
public StandardThreadFactory(String groupName)
groupName - the name of the ThreadGroup (is allowed to be null).public StandardThreadFactory(int priority)
priority - the priority of th threads.
IllegalArgumentException - if the priority is not valid.
public StandardThreadFactory(int priority,
String groupName)
priority - the priority of the threads this StandardThreadFactory is going to createReference.groupName - the name of the ThreadGroup (is allowed to be null).
IllegalArgumentException - if priority is not a valid value.
public StandardThreadFactory(int priority,
ThreadGroup threadGroup)
priority - the priority of the created threads.threadGroup - the ThreadGroup the created Threads are part of.
NullPointerException - if threadGroup is null
IllegalArgumentException - if the priority is not valid value.
public StandardThreadFactory(int priority,
boolean daemon)
public StandardThreadFactory(int priority,
ThreadGroup threadGroup,
boolean daemon)
priority - the priority of the threads this StandardThreadFactory is going to createReference.threadGroup - the threadgroup the thread is part ofdaemon - if the thread should be a daemon.
IllegalArgumentException - if the priority is not valid.
NullPointerException - if threadGroup is null.| Method Detail |
|---|
public boolean isProducingDaemons()
public ThreadGroup getThreadGroup()
public int getPriority()
public void setPriority(int priority)
priority - the new priority.
IllegalArgumentException - if priority is smaller than Thread.MIN_PRIORITY or
larger than Thread.MAX_PRIORITY or larger than the
maximum priority of the ThreadGroup.public Thread newThread(Runnable runnable)
newThread in interface ThreadFactory
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||