com.kuka.common
Class NamedSingleThreadFactory
java.lang.Object
com.kuka.common.NamedThreadFactory
com.kuka.common.NamedSingleThreadFactory
- All Implemented Interfaces:
- ThreadFactory
public class NamedSingleThreadFactory
- extends NamedThreadFactory
Thread Factory whose threads are named. This thread factory is intended to
only create one thread at a time.
- This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NamedSingleThreadFactory
public NamedSingleThreadFactory(String threadFactoryName,
boolean daemon,
int priority,
Thread.UncaughtExceptionHandler exceptionHandler)
- Creates a new thread factory with the specified name and priority.
- Parameters:
threadFactoryName - name of the thread factory.priority - the priority of the threads.daemon - indicates whether all threads of this factory are daemon
threads or not.exceptionHandler - unhandled exception handler for the pool threads, if set to
null default handler which just logs the
exception will be used.- This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.
newThread
public Thread newThread(Runnable r)
- Specified by:
newThread in interface ThreadFactory- Overrides:
newThread in class NamedThreadFactory
killCurrentThread
public void killCurrentThread()
- Kills the currently running thread.
WARNING:
- If this class is used to create more than one thread at the same
time, only the last created thread is killed.
- Killing a thread causes it to unlock all of the monitors that it has
locked (as a natural consequence of the unchecked ThreadDeath exception
propagating up the stack). If any of the objects previously protected by
these monitors were in an inconsistent state, the damaged objects become
visible to other threads, potentially resulting in arbitrary behavior.
- This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.
Copyright © 2019. All rights reserved.