Top Description Constructors Methods
org.springframework.scheduling.concurrent

public Class CustomizableThreadFactory

extends CustomizableThreadCreator
implements ThreadFactory
Class Inheritance
All Implemented Interfaces
java.util.concurrent.ThreadFactory
Known Direct Subclasses
org.springframework.scheduling.concurrent.DefaultManagedAwareThreadFactory, org.springframework.scheduling.concurrent.ExecutorConfigurationSupport
Annotations
@SuppressWarnings:serial
Imports
java.util.concurrent.ThreadFactory, org.springframework.util.CustomizableThreadCreator

Implementation of the java.util.concurrent.ThreadFactory interface, allowing for customizing the created threads (name, priority, etc).

See the base class org.springframework.util.CustomizableThreadCreator for details on the available configuration options.

Author
Juergen Hoeller
Since
2.0.3
See Also
setThreadNamePrefix, setThreadPriority

Constructor Summary

AccessConstructor and Description
public
CustomizableThreadFactory()

Create a new CustomizableThreadFactory with default thread name prefix.

public
CustomizableThreadFactory(String
the prefix to use for the names of newly created threads
threadNamePrefix
)

Create a new CustomizableThreadFactory with the given thread name prefix.

Method Summary

Modifier and TypeMethod and Description
public Thread
newThread(Runnable
a runnable to be executed by new thread instance
runnable
)

Implements java.util.concurrent.ThreadFactory.newThread.

Constructs a new unstarted Thread to run the given runnable.
Inherited from org.springframework.util.CustomizableThreadCreator:
createThreadgetDefaultThreadNamePrefixgetThreadGroupgetThreadNamePrefixgetThreadPriorityisDaemonnextThreadNamesetDaemonsetThreadGroupsetThreadGroupNamesetThreadNamePrefixsetThreadPriority

Constructor Detail

CustomizableThreadFactoryback to summary
public CustomizableThreadFactory()

Create a new CustomizableThreadFactory with default thread name prefix.

CustomizableThreadFactoryback to summary
public CustomizableThreadFactory(String threadNamePrefix)

Create a new CustomizableThreadFactory with the given thread name prefix.

Parameters
threadNamePrefix:String

the prefix to use for the names of newly created threads

Method Detail

newThreadback to summary
public Thread newThread(Runnable runnable)

Implements java.util.concurrent.ThreadFactory.newThread.

Doc from java.util.concurrent.ThreadFactory.newThread.

Constructs a new unstarted Thread to run the given runnable.

Parameters
runnable:Runnable

a runnable to be executed by new thread instance

Returns:Thread

constructed thread, or null if the request to create a thread is rejected

Annotations
@Override