Top Description Fields Constructors Methods
io.github.resilience4j.core

public Class NamingThreadFactory

extends Object
implements ThreadFactory
Class Inheritance
All Implemented Interfaces
java.util.concurrent.ThreadFactory
Imports
java.util.concurrent.Executors, .ThreadFactory, java.util.concurrent.atomic.AtomicInteger

Creates threads using "$name-%d" pattern for naming. Is based on Executors#defaultThreadFactory

Field Summary

Modifier and TypeField and Description
private final ThreadGroup
private final String
private final AtomicInteger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private String
private ThreadGroup
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 java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

groupback to summary
private final ThreadGroup group
prefixback to summary
private final String prefix
threadNumberback to summary
private final AtomicInteger threadNumber

Constructor Detail

NamingThreadFactoryback to summary
public NamingThreadFactory(String name)

Method Detail

createNameback to summary
private String createName()
getThreadGroupback to summary
private ThreadGroup getThreadGroup()
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