forked from venasolutions/bosk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fold MirroringDriver into ReplicaSet.
Also simplify ForwardingDriver by giving it just one single downstream driver. We were never using two or more anyway, and for the zero case, we've made a new NoOpDriver.
- Loading branch information
Showing
9 changed files
with
120 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 0 additions & 89 deletions
89
bosk-core/src/main/java/works/bosk/drivers/MirroringDriver.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
bosk-core/src/main/java/works/bosk/drivers/NoOpDriver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package works.bosk.drivers; | ||
|
||
import java.io.IOException; | ||
import java.lang.reflect.Type; | ||
import works.bosk.BoskDriver; | ||
import works.bosk.DriverFactory; | ||
import works.bosk.Identifier; | ||
import works.bosk.Reference; | ||
import works.bosk.StateTreeNode; | ||
import works.bosk.exceptions.InvalidTypeException; | ||
|
||
public class NoOpDriver<R extends StateTreeNode> implements BoskDriver<R> { | ||
public static <RR extends StateTreeNode> DriverFactory<RR> factory() { | ||
return (b,d) -> new NoOpDriver<>(); | ||
} | ||
|
||
@Override | ||
public R initialRoot(Type rootType) throws InvalidTypeException, IOException, InterruptedException { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override public <T> void submitReplacement(Reference<T> target, T newValue) { } | ||
@Override public <T> void submitConditionalReplacement(Reference<T> target, T newValue, Reference<Identifier> precondition, Identifier requiredValue) { } | ||
@Override public <T> void submitInitialization(Reference<T> target, T newValue) { } | ||
@Override public <T> void submitDeletion(Reference<T> target) { } | ||
@Override public <T> void submitConditionalDeletion(Reference<T> target, Reference<Identifier> precondition, Identifier requiredValue) { } | ||
@Override public void flush() throws IOException, InterruptedException { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.