Package org.dataloader.registries
Class ScheduledDataLoaderRegistry.Builder
- java.lang.Object
-
- org.dataloader.registries.ScheduledDataLoaderRegistry.Builder
-
- Enclosing class:
- ScheduledDataLoaderRegistry
public static class ScheduledDataLoaderRegistry.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScheduledDataLoaderRegistry
build()
ScheduledDataLoaderRegistry.Builder
dispatchPredicate(DispatchPredicate dispatchPredicate)
This sets a default predicate on theDataLoaderRegistry
that will control whether allDataLoader
s in theDataLoaderRegistry
should be dispatched.ScheduledDataLoaderRegistry.Builder
instrumentation(DataLoaderInstrumentation instrumentation)
ScheduledDataLoaderRegistry.Builder
register(java.lang.String key, DataLoader<?,?> dataLoader)
This will register a new dataloaderScheduledDataLoaderRegistry.Builder
register(java.lang.String key, DataLoader<?,?> dataLoader, DispatchPredicate dispatchPredicate)
This will register a new dataloader with a specificDispatchPredicate
ScheduledDataLoaderRegistry.Builder
registerAll(DataLoaderRegistry otherRegistry)
This will combine the data loaders in this builder with the ones from a previousDataLoaderRegistry
ScheduledDataLoaderRegistry.Builder
schedule(java.time.Duration schedule)
ScheduledDataLoaderRegistry.Builder
scheduledExecutorService(java.util.concurrent.ScheduledExecutorService executorService)
If you provide aScheduledExecutorService
then it will NOT be shutdown whenScheduledDataLoaderRegistry.close()
is called.ScheduledDataLoaderRegistry.Builder
tickerMode(boolean tickerMode)
This sets ticker mode on the registry.
-
-
-
Method Detail
-
scheduledExecutorService
public ScheduledDataLoaderRegistry.Builder scheduledExecutorService(java.util.concurrent.ScheduledExecutorService executorService)
If you provide aScheduledExecutorService
then it will NOT be shutdown whenScheduledDataLoaderRegistry.close()
is called. This is left to the code that made this setup code- Parameters:
executorService
- the executor service to run the ticker on- Returns:
- this builder for a fluent pattern
-
schedule
public ScheduledDataLoaderRegistry.Builder schedule(java.time.Duration schedule)
-
register
public ScheduledDataLoaderRegistry.Builder register(java.lang.String key, DataLoader<?,?> dataLoader)
This will register a new dataloader- Parameters:
key
- the key to put the data loader underdataLoader
- the data loader to register- Returns:
- this builder for a fluent pattern
-
register
public ScheduledDataLoaderRegistry.Builder register(java.lang.String key, DataLoader<?,?> dataLoader, DispatchPredicate dispatchPredicate)
This will register a new dataloader with a specificDispatchPredicate
- Parameters:
key
- the key to put the data loader underdataLoader
- the data loader to registerdispatchPredicate
- the dispatch predicate- Returns:
- this builder for a fluent pattern
-
registerAll
public ScheduledDataLoaderRegistry.Builder registerAll(DataLoaderRegistry otherRegistry)
This will combine the data loaders in this builder with the ones from a previousDataLoaderRegistry
- Parameters:
otherRegistry
- the previousDataLoaderRegistry
- Returns:
- this builder for a fluent pattern
-
dispatchPredicate
public ScheduledDataLoaderRegistry.Builder dispatchPredicate(DispatchPredicate dispatchPredicate)
This sets a default predicate on theDataLoaderRegistry
that will control whether allDataLoader
s in theDataLoaderRegistry
should be dispatched.- Parameters:
dispatchPredicate
- the predicate- Returns:
- this builder for a fluent pattern
-
tickerMode
public ScheduledDataLoaderRegistry.Builder tickerMode(boolean tickerMode)
This sets ticker mode on the registry. When ticker mode is true the registry will continuously reschedule the data loaders for possible dispatching after the first call to dispatchAll.- Parameters:
tickerMode
- true or false- Returns:
- this builder for a fluent pattern
-
instrumentation
public ScheduledDataLoaderRegistry.Builder instrumentation(DataLoaderInstrumentation instrumentation)
-
build
public ScheduledDataLoaderRegistry build()
- Returns:
- the newly built
ScheduledDataLoaderRegistry
-
-