com.kuka.common
Class NamedThreadFactory

java.lang.Object
  extended by com.kuka.common.NamedThreadFactory
All Implemented Interfaces:
ThreadFactory
Direct Known Subclasses:
NamedSingleThreadFactory

public class NamedThreadFactory
extends Object
implements ThreadFactory

Thread Factory whose threads are named.

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.

Constructor Summary
NamedThreadFactory(String threadFactoryName)
          Creates a new thread factory with the specified name.
NamedThreadFactory(String threadFactoryName, boolean daemon)
          Creates a new thread factory with the specified name.
NamedThreadFactory(String threadFactoryName, boolean daemon, int priority, Thread.UncaughtExceptionHandler exceptionHandler)
          Creates a new thread factory with the specified name and priority.
NamedThreadFactory(String threadFactoryName, boolean daemon, int priority, Thread.UncaughtExceptionHandler exceptionHandler, ThreadGroup threadGroup)
          Creates a new thread factory with the specified name and priority.
NamedThreadFactory(ThreadGroup threadGroup, String threadFactoryName)
          Creates a new thread factory with the specified name.
 
Method Summary
protected  Thread.UncaughtExceptionHandler getExceptionHandler()
          gets the exception handler for uncaught exceptions for the thread factory threads.
protected  String getNamePrefix()
          gets the name prefix for the threads.
protected  ThreadGroup getThreadGroup()
          gets the threads group.
protected  int getThreadPriority()
          gets the thread priority.
protected  boolean isDaemon()
          Indicates that the threads of the factory are daemon threads.
 Thread newThread(Runnable r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamedThreadFactory

public NamedThreadFactory(String threadFactoryName)
Creates a new thread factory with the specified name. The Threads are started as non-daemon threads with normal priority.

Parameters:
threadFactoryName - name of the thread factory.
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.

NamedThreadFactory

public NamedThreadFactory(String threadFactoryName,
                          boolean daemon)
Creates a new thread factory with the specified name. The Threads are started with normal priority.

Parameters:
threadFactoryName - name of the thread factory.
daemon - indicates whether all threads of this factory are daemon threads or not.
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.

NamedThreadFactory

public NamedThreadFactory(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.

NamedThreadFactory

public NamedThreadFactory(ThreadGroup threadGroup,
                          String threadFactoryName)
Creates a new thread factory with the specified name. The Threads are started as non-daemon threads with normal priority.

Parameters:
threadGroup - thread group for newly created threads. If null and a security manager is present, System.getSecurityManager().getThreadGroup() will be used. If null and no security manager is present, the current thread group will be used.
threadFactoryName - name of the thread factory.

NamedThreadFactory

public NamedThreadFactory(String threadFactoryName,
                          boolean daemon,
                          int priority,
                          Thread.UncaughtExceptionHandler exceptionHandler,
                          ThreadGroup threadGroup)
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.
threadGroup - the thread group parent for all threads being created by this factory.
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.
Method Detail

newThread

public Thread newThread(Runnable r)
Specified by:
newThread in interface ThreadFactory

getThreadPriority

protected int getThreadPriority()
gets the thread priority.

Returns:
the thread priority
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.

isDaemon

protected boolean isDaemon()
Indicates that the threads of the factory are daemon threads.

Returns:
true if the threads are daemon threads.
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.

getExceptionHandler

protected Thread.UncaughtExceptionHandler getExceptionHandler()
gets the exception handler for uncaught exceptions for the thread factory threads.

Returns:
the exception handler
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.

getThreadGroup

protected ThreadGroup getThreadGroup()
gets the threads group.

Returns:
the thread group
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.

getNamePrefix

protected String getNamePrefix()
gets the name prefix for the threads.

Returns:
the name prefix
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.