public final class DefaultThreadFactory extends Object implements ThreadFactory
Constructor and Description |
---|
DefaultThreadFactory(String prefix)
Constructs a default thread factory.
|
DefaultThreadFactory(String prefix,
Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Constructs a default thread factory.
|
Modifier and Type | Method and Description |
---|---|
Thread |
newThread(Runnable r)
Creates a new thread.
|
void |
setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Sets a uncaught exception handler.
|
public DefaultThreadFactory(String prefix)
prefix
- the name prefix of the created threadpublic DefaultThreadFactory(String prefix, Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
prefix
- the name prefix of the created threaduncaughtExceptionHandler
- the uncaught exception handler of the created threadpublic void setUncaughtExceptionHandler(Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
uncaughtExceptionHandler
- the uncaught exception handlerpublic Thread newThread(Runnable r)
newThread
in interface ThreadFactory
r
- the runnableCopyright © 2016 The Apache Software Foundation. All rights reserved.