public class ThreadFactoryTracker
extends java.lang.Object
implements java.util.concurrent.ThreadFactory
All user threads are interrupted when the tracker is shutdown.
Runnable implementations (see Source
) must exit the task
if the current thread is interrupted. A handler which notifies the
Executable
is invoked when a user thread abruptly terminates due
to an uncaught exception.
If no ThreadFactory
is provided, then this object uses the
factory returned by Executors.defaultThreadFactory()
.
Modifier and Type | Method and Description |
---|---|
boolean |
hasActiveNonDaemonThreads()
Check to see if there are non daemon user threads that have not yet
completed.
|
java.lang.Thread |
newThread(java.lang.Runnable r)
Return a thread.
|
void |
shutdown()
This initiates an orderly shutdown in which no new tasks will be
accepted but previously submitted tasks continue to be executed.
|
void |
shutdownNow()
Interrupts all user treads and briefly waits for each thread to finish
execution.
|
public java.lang.Thread newThread(java.lang.Runnable r)
newThread
in interface java.util.concurrent.ThreadFactory
public void shutdown()
public void shutdownNow()
InterruptedException
and exit the task.public boolean hasActiveNonDaemonThreads()
true
if there are active non daemon threads, false otherwise.Copyright © 2016 The Apache Software Foundation. All Rights Reserved - bbe71fa-20161201-1641