Top Description Inners Fields Constructors Methods
reactor.core.scheduler

pack-priv Class ReactorThreadFactory

extends Object
implements ThreadFactory, Supplier<String>, UncaughtExceptionHandler
Class Inheritance
All Implemented Interfaces
java.lang.Thread.UncaughtExceptionHandler, java.util.function.Supplier, java.util.concurrent.ThreadFactory
Imports
java.util.concurrent.ThreadFactory, java.util.concurrent.atomic.AtomicLong, java.util.function.BiConsumer, .Supplier, reactor.util.annotation.NonNull, .Nullable

The standard Reactor Thread factories to be used by Scheduler, creating Thread with a prefix (which can be retrieved with the get() method).
Author
Simon Baslé

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final AtomicLong
private final boolean
private final String
private final boolean
private final BiConsumer<Thread, Throwable>

Constructor Summary

AccessConstructor and Description
pack-priv
ReactorThreadFactory(String name, AtomicLong counterReference, boolean daemon, boolean rejectBlocking, BiConsumer<Thread, Throwable> uncaughtExceptionHandler)

Method Summary

Modifier and TypeMethod and Description
public final String

Returns:

the thread name prefix
get
()

Implements java.util.function.Supplier.get.

Get the prefix used for new Threads created by this ThreadFactory.
public final 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.
public void
uncaughtException(Thread
the thread
t
,
Throwable
the exception
e
)

Implements java.lang.Thread.UncaughtExceptionHandler.uncaughtException.

Method invoked when the given thread terminates due to the given uncaught exception.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

counterReferenceback to summary
private final AtomicLong counterReference
daemonback to summary
private final boolean daemon
nameback to summary
private final String name
rejectBlockingback to summary
private final boolean rejectBlocking
uncaughtExceptionHandlerback to summary
private final BiConsumer<Thread, Throwable> uncaughtExceptionHandler
Annotations
@Nullable

Constructor Detail

ReactorThreadFactoryback to summary
pack-priv ReactorThreadFactory(String name, AtomicLong counterReference, boolean daemon, boolean rejectBlocking, BiConsumer<Thread, Throwable> uncaughtExceptionHandler)

Method Detail

getback to summary
public final String get()

Implements java.util.function.Supplier.get.

Get the prefix used for new Threads created by this ThreadFactory. The factory can also be seen as a Supplier<String>.

Returns:String

the thread name prefix

Annotations
@Override
newThreadback to summary
public final 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
uncaughtExceptionback to summary
public void uncaughtException(Thread t, Throwable e)

Implements java.lang.Thread.UncaughtExceptionHandler.uncaughtException.

Doc from java.lang.Thread.UncaughtExceptionHandler.uncaughtException.

Method invoked when the given thread terminates due to the given uncaught exception.

Any exception thrown by this method will be ignored by the Java Virtual Machine.

Parameters
t:Thread

the thread

e:Throwable

the exception

Annotations
@Override
reactor.core.scheduler back to summary

pack-priv final Class ReactorThreadFactory.NonBlockingThread

extends Thread
implements NonBlocking
Class Inheritance
All Implemented Interfaces
reactor.core.scheduler.NonBlocking

Field Summary

Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.Thread:
activeCountcheckAccessclonecountStackFramescurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitresumerunsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopsuspendthreadIdtoStringyield

Constructor Detail

NonBlockingThreadback to summary
public NonBlockingThread(Runnable target, String name)