public interface ThreadFactory
| Modifier and Type | Method and Description |
|---|---|
Thread |
createThread(Runnable target)
Factory method to create Thread objects.
|
void |
handleThrowable(Throwable throwable)
Callback method if an Throwable occurs during starting a thread.
|
void |
initThread()
Initialize resources of a new thread.
|
void |
termThread()
Free resources of a new thread.
|
Thread createThread(Runnable target)
The resulting object must not be of class Thread, but can
also be of any Class derived from class Thread.
target - the object whose run() method gets calledvoid initThread()
void termThread()
void handleThrowable(Throwable throwable)
A component that uses a thread factory (e.g. a thread pool) can call this method to notify the thread factory about problems when creating a thread.
throwable - a throwable that occurred during starting a threadCopyright © 2005–2020. All rights reserved.