Class ThreadFactoryProvider

  • Direct Known Subclasses:
    ImmutableThreadFactoryProvider

    @Immutable
    public abstract class ThreadFactoryProvider
    extends Object
    Builder for ThreadFactory. Easier to use than the ThreadFactoryBuilder, because it enforces setting all required properties through a staged builder.
    Author:
    Michael Vorburger.ch
    • Constructor Detail

      • ThreadFactoryProvider

        public ThreadFactoryProvider()
    • Method Detail

      • 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.