org.mariadb.jdbc.internal.util.scheduler

## Class SchedulerServiceProviderHolder

- java.lang.Object
- - org.mariadb.jdbc.internal.util.scheduler.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.

### Nested Class Summary

Nested Classes
`static interface` `SchedulerServiceProviderHolder.SchedulerProvider` Provider for thread pools which allow scheduling capabilities.

### Field Summary

Fields
`static SchedulerServiceProviderHolder.SchedulerProvider` `DEFAULT_PROVIDER` The default provider will construct a new pool on every request.

### Constructor Summary

Constructors
Constructor and Description
`SchedulerServiceProviderHolder()`

### Method Summary

All Methods Static Methods Concrete Methods
`static ThreadPoolExecutor` `getBulkScheduler()`
`static ScheduledExecutorService` `getFixedSizeScheduler(int initialThreadCount, String poolName)` Get a fixed sized scheduler directly with the current set provider.
`static DynamicSizedSchedulerInterface` `getScheduler(int initialThreadCount, String poolName, int maximumPoolSize)` Get a Dynamic sized scheduler directly with the current set provider.
`static SchedulerServiceProviderHolder.SchedulerProvider` `getSchedulerProvider()` Get the currently set `SchedulerServiceProviderHolder.SchedulerProvider` from set invocations via `setSchedulerProvider(SchedulerProvider)`.
`static ScheduledExecutorService` `getTimeoutScheduler()` Get a scheduler to handle timeout.
`static void` `setSchedulerProvider(SchedulerServiceProviderHolder.SchedulerProvider newProvider)` Change the current set scheduler provider.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_PROVIDER

    public static final SchedulerServiceProviderHolder.SchedulerProvider DEFAULT_PROVIDER

The default provider will construct a new pool on every request.

### Constructor Detail

#### SchedulerServiceProviderHolder

    public SchedulerServiceProviderHolder()

### Method Detail

#### getSchedulerProvider

    public static SchedulerServiceProviderHolder.SchedulerProvider getSchedulerProvider()

Get the currently set `SchedulerServiceProviderHolder.SchedulerProvider` from set invocations via `setSchedulerProvider(SchedulerProvider)`. If none has been set a default provider will be provided (never a `null` result).

Returns:
  Provider to get scheduler pools from

#### setSchedulerProvider

    public static void setSchedulerProvider(SchedulerServiceProviderHolder.SchedulerProvider newProvider)

Change the current set scheduler provider. This provider will be provided in future requests to `getSchedulerProvider()`.

Parameters:
  `newProvider` - New provider to use, or `null` to use the default provider

#### 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

#### getBulkScheduler

    public static ThreadPoolExecutor getBulkScheduler()