java.lang.Object | |
↳ | org.springframework.util.CustomizableThreadCreator |
Known Direct Subclasses |
Known Indirect Subclasses |
Simple customizable helper class for creating threads. Provides various bean properties, such as thread name prefix, thread priority, etc.
Serves as base class for thread factories such as
CustomizableThreadFactory
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new CustomizableThreadCreator with default thread name prefix.
| |||||||||||
Create a new CustomizableThreadCreator with the given thread name prefix.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Template method for the creation of a Thread.
| |||||||||||
Return the thread group that threads should be created in
(or
null ) for the default group. | |||||||||||
Return the thread name prefix to use for the names of newly
created threads.
| |||||||||||
Return the priority of the threads that this factory creates.
| |||||||||||
Return whether this factory should create daemon threads.
| |||||||||||
Set whether this factory is supposed to create daemon threads,
just executing as long as the application itself is running.
| |||||||||||
Specify the thread group that threads should be created in.
| |||||||||||
Specify the name of the thread group that threads should be created in.
| |||||||||||
Specify the prefix to use for the names of newly created threads.
| |||||||||||
Set the priority of the threads that this factory creates.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Build the default thread name prefix for this factory.
| |||||||||||
Return the thread name to use for a newly created thread.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a new CustomizableThreadCreator with default thread name prefix.
Create a new CustomizableThreadCreator with the given thread name prefix.
threadNamePrefix | the prefix to use for the names of newly created threads |
---|
Template method for the creation of a Thread.
Default implementation creates a new Thread for the given Runnable, applying an appropriate thread name.
runnable | the Runnable to execute |
---|
Return the thread group that threads should be created in
(or null
) for the default group.
Return the thread name prefix to use for the names of newly created threads.
Return the priority of the threads that this factory creates.
Return whether this factory should create daemon threads.
Set whether this factory is supposed to create daemon threads, just executing as long as the application itself is running.
Default is "false": Concrete factories usually support explicit cancelling. Hence, if the application shuts down, Runnables will by default finish their execution.
Specify "true" for eager shutdown of threads which still actively execute a Runnable.
Specify the thread group that threads should be created in.
Specify the name of the thread group that threads should be created in.
Specify the prefix to use for the names of newly created threads. Default is "SimpleAsyncTaskExecutor-".
Set the priority of the threads that this factory creates. Default is 5.
Build the default thread name prefix for this factory.
null
)
Return the thread name to use for a newly created thread.
Default implementation returns the specified thread name prefix with an increasing thread count appended: for example, "SimpleAsyncTaskExecutor-0".