- //
- //
- // Methods below are invoked from the client actor thread
- //
- //
-
- @Override
- protected void haltClient(final Throwable cause) {
- // FIXME: Add state flushing here once we have state
- }
-
- private ClientActorBehavior createLocalHistory(final CompletableFuture<ClientLocalHistory> future) {
- final LocalHistoryIdentifier historyId = new LocalHistoryIdentifier(getIdentifier(), nextHistoryId++);
- LOG.debug("{}: creating a new local history {} for {}", persistenceId(), historyId, future);
-
- // FIXME: initiate backend instantiation
- future.completeExceptionally(new UnsupportedOperationException("Not implemented yet"));
- return this;
- }
-
- private ClientActorBehavior shutdown() {
- // FIXME: Add shutdown procedures here
- return null;
- }
-
- @Override
- protected ClientActorBehavior onCommand(final Object command) {
- if (command instanceof GetClientRequest) {
- ((GetClientRequest) command).getReplyTo().tell(new Status.Success(this), ActorRef.noSender());
- } else {
- LOG.warn("{}: ignoring unhandled command {}", persistenceId(), command);
- }
-
- return this;
- }
-
- //
- //
- // Methods below are invoked from application threads
- //
- //
-
- @Override
- public CompletionStage<ClientLocalHistory> createLocalHistory() {
- final CompletableFuture<ClientLocalHistory> future = new CompletableFuture<>();
- context().executeInActor(() -> createLocalHistory(future));
- return future;
+ DistributedDataStoreClientBehavior(final ClientActorContext context, final ActorContext actorContext) {
+ this(context, new ModuleShardBackendResolver(context.getIdentifier(), actorContext));