Package org.dataloader.registries
Class ScheduledDataLoaderRegistry.Builder
java.lang.Object
org.dataloader.registries.ScheduledDataLoaderRegistry.Builder
- Enclosing class:
- ScheduledDataLoaderRegistry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
dispatchPredicate
(DispatchPredicate dispatchPredicate) This sets a default predicate on theDataLoaderRegistry
that will control whether allDataLoader
s in theDataLoaderRegistry
should be dispatched.instrumentation
(DataLoaderInstrumentation instrumentation) register
(String key, DataLoader<?, ?> dataLoader) This will register a new dataloaderregister
(String key, DataLoader<?, ?> dataLoader, DispatchPredicate dispatchPredicate) This will register a new dataloader with a specificDispatchPredicate
registerAll
(DataLoaderRegistry otherRegistry) This will combine the data loaders in this builder with the ones from a previousDataLoaderRegistry
scheduledExecutorService
(ScheduledExecutorService executorService) If you provide aScheduledExecutorService
then it will NOT be shutdown whenScheduledDataLoaderRegistry.close()
is called.tickerMode
(boolean tickerMode) This sets ticker mode on the registry.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
scheduledExecutorService
public ScheduledDataLoaderRegistry.Builder scheduledExecutorService(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
-
register
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(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
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
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
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
- Returns:
- the newly built
ScheduledDataLoaderRegistry
-