Class SchedulerServiceProviderHolder


  • public class SchedulerServiceProviderHolder
    extends Object
    Provider for when ever an internal thread pool is needed. This can allow library users to override our default pooling behavior with possibly better and faster options.
    • Constructor Detail

      • SchedulerServiceProviderHolder

        public SchedulerServiceProviderHolder()
    • Method Detail

      • close

        public static void close()
        Close currentProvider.
      • getScheduler

        public static DynamicSizedSchedulerInterface getScheduler​(int initialThreadCount,
                                                                  String poolName,
                                                                  int maximumPoolSize)
        Get a Dynamic sized scheduler directly with the current set provider.
        Parameters:
        initialThreadCount - Number of threads scheduler is allowed to grow to
        poolName - name of pool to identify threads
        maximumPoolSize - maximum pool size
        Returns:
        Scheduler capable of providing the needed thread count
      • getFixedSizeScheduler

        public static ScheduledExecutorService getFixedSizeScheduler​(int initialThreadCount,
                                                                     String poolName)
        Get a fixed sized scheduler directly with the current set provider.
        Parameters:
        initialThreadCount - Number of threads scheduler is allowed to grow to
        poolName - name of pool to identify threads
        Returns:
        Scheduler capable of providing the needed thread count
      • getTimeoutScheduler

        public static ScheduledExecutorService getTimeoutScheduler()
        Get a scheduler to handle timeout.
        Returns:
        Scheduler capable of providing the needed thread count