Skip to content

Commit 01a72d6

Browse files
committed
Review comments
1 parent ab0ca13 commit 01a72d6

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/main/java/org/dataloader/DataLoaderRegistry.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,25 @@ public Builder registerAll(DataLoaderRegistry otherRegistry) {
368368
return this;
369369
}
370370

371+
/**
372+
* The {@link DataLoaderInstrumentation} to use for this registry
373+
*
374+
* @param instrumentation instrumentation to use
375+
*
376+
* @return the builder for a fluent pattern
377+
*/
371378
public Builder instrumentation(DataLoaderInstrumentation instrumentation) {
372379
this.instrumentation = instrumentation;
373380
return this;
374381
}
375382

383+
/**
384+
* The {@link DispatchStrategy} to use for this registry
385+
*
386+
* @param dispatchStrategy strategy to use
387+
*
388+
* @return this builder for a fluent pattern
389+
*/
376390
public Builder dispatchStrategy(DispatchStrategy dispatchStrategy) {
377391
this.dispatchStrategy = dispatchStrategy;
378392
return this;

src/main/java/org/dataloader/DispatchStrategy.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,37 @@
55

66
import java.util.concurrent.atomic.AtomicBoolean;
77

8+
/**
9+
* An interface to implement to allow for custom dispatch strategies when executing {@link DataLoader}s
10+
*/
811
@NullMarked
912
@PublicApi
1013
public interface DispatchStrategy {
1114

15+
/**
16+
* A {@link DispatchStrategy} that does nothing
17+
*/
1218
DispatchStrategy NO_OP = new DispatchStrategy() {
1319
};
1420

21+
/**
22+
* Lifecycle method called when the registry is created that this dispatch strategy is attached to
23+
* @param registry the {@link DataLoaderRegistry} this dispatch strategy is attached to
24+
*/
1525
default void onRegistryCreation(DataLoaderRegistry registry) {
1626

1727
}
1828

29+
/**
30+
* Called when a {@link DataLoader#load(Object)} is called on a dataloader
31+
*/
1932
default void loadCalled() {
2033

2134
}
2235

36+
/**
37+
* Called when a {@link DataLoader#load(Object)} is executed and completed on a dataloader
38+
*/
2339
default void loadCompleted() {
2440

2541
}

0 commit comments

Comments
 (0)