Class ThreadFactoryProvider
- java.lang.Object
-
- org.opendaylight.infrautils.utils.concurrent.ThreadFactoryProvider
-
- Direct Known Subclasses:
ImmutableThreadFactoryProvider
@Immutable public abstract class ThreadFactoryProvider extends Object
Builder forThreadFactory. Easier to use than theThreadFactoryBuilder, because it enforces setting all required properties through a staged builder.- Author:
- Michael Vorburger.ch
-
-
Constructor Summary
Constructors Constructor Description ThreadFactoryProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static ImmutableThreadFactoryProvider.NamePrefixBuildStagebuilder()booleandaemon()Daemon or not for new threads created via this factory.ThreadFactoryget()abstract org.slf4j.Loggerlogger()Logger used to log uncaught exceptions from new threads created via this factory.abstract StringnamePrefix()Prefix for threads from this factory.abstract Optional<Integer>priority()Priority for new threads from this factory.
-
-
-
Method Detail
-
builder
public static ImmutableThreadFactoryProvider.NamePrefixBuildStage builder()
-
namePrefix
@Parameter public abstract String namePrefix()
Prefix for threads from this factory. For example, "rpc-pool", to create "rpc-pool-1/2/3" named threads. Note that this is a prefix, not a format, so you pass just "rpc-pool" instead of e.g. "rpc-pool-%d".
-
logger
@Parameter public abstract org.slf4j.Logger logger()
Logger used to log uncaught exceptions from new threads created via this factory.
-
priority
@Parameter public abstract Optional<Integer> priority()
Priority for new threads from this factory.
-
daemon
@Default public boolean daemon()
Daemon or not for new threads created via this factory. NB: Defaults to true.
-
get
public ThreadFactory get()
-
-