Stand

public class Stand implements AutoCloseable

A bridge which connects QueryService and SubscriptionService with a Read-side of a Bounded Context.

Each BoundedContext contains only one instance of Stand.

The Stand is responsible for obtaining results of queries sent by the QueryService.

The Stand also manages creation of subscriptions, their activation, and delivering updates to the subscribers when requested by the SubscriptionService.

See also

<a href="https://spine.io/docs/concepts/diagrams/spine-architecture-diagram-full-screen.html">

Spine Architecture Diagram

Types

Link copied to clipboard
public class Builder

Functions

Link copied to clipboard
public void activate(Subscription subscription, SubscriptionCallback callback, StreamObserver<Response> responseObserver)
Activates the subscription created via subscribe() method.
Link copied to clipboard
public void cancel(Subscription subscription, StreamObserver<Response> responseObserver)
Cancels the Subscription.
Link copied to clipboard
public void close()
Closes the Stand performing necessary cleanups.
Link copied to clipboard
Obtains the bus listener which propagates all events and state updates to subscriptions.
Link copied to clipboard
public void execute(Query query, StreamObserver<QueryResponse> responseObserver)
Reads a particular set of items from the read-side of the application and feed the result into an instance.
Link copied to clipboard
public ImmutableSet<TypeUrl> exposedAggregateTypes()
Reads all Aggregate entity types exposed for reading by this instance of Stand.
Link copied to clipboard
public ImmutableSet<TypeUrl> exposedEventTypes()
Reads all event types produced by the repositories associated with this Stand.
Link copied to clipboard
public ImmutableSet<TypeUrl> exposedTypes()
Reads all Entity types exposed for reading by this instance of Stand.
Link copied to clipboard
public boolean isMultitenant()
Link copied to clipboard
public static Stand.Builder newBuilder()
Link copied to clipboard
public void registerTypeSupplier(EventProducer producer)
Registers the passed EventProducer as the event type supplier.
public void registerTypeSupplier(Repository<? extends Object, ? extends Object> repository)
Registers the passed Repository as an entity/event type supplier.
Link copied to clipboard
public void subscribe(Subscription subscription)
Registers this inactive subscription is this Stand.
public void subscribe(Topic topic, StreamObserver<Subscription> responseObserver)
Creates a subscription for the passed topic.