Search in sources :

Example 6 with Stand

use of io.spine.server.stand.Stand in project core-java by SpineEventEngine.

the class SubscriptionService method subscribe.

@Override
public void subscribe(Topic topic, StreamObserver<Subscription> responseObserver) {
    log().debug("Creating the subscription to a topic: {}", topic);
    try {
        final Target target = topic.getTarget();
        final BoundedContext boundedContext = selectBoundedContext(target);
        final Stand stand = boundedContext.getStand();
        stand.subscribe(topic, responseObserver);
    } catch (@SuppressWarnings("OverlyBroadCatchBlock") Exception e) {
        log().error("Error processing subscription request", e);
        responseObserver.onError(e);
    }
}
Also used : Stand(io.spine.server.stand.Stand) Target(io.spine.client.Target)

Example 7 with Stand

use of io.spine.server.stand.Stand in project core-java by SpineEventEngine.

the class BoundedContextShould method propagate_registered_repositories_to_stand.

@Test
public void propagate_registered_repositories_to_stand() {
    final BoundedContext boundedContext = BoundedContext.newBuilder().build();
    final Stand stand = Spy.ofClass(Stand.class).on(boundedContext);
    verify(stand, never()).registerTypeSupplier(any(Repository.class));
    final ProjectAggregateRepository repository = new ProjectAggregateRepository(boundedContext);
    boundedContext.register(repository);
    verify(stand).registerTypeSupplier(eq(repository));
}
Also used : Stand(io.spine.server.stand.Stand) AggregateRepository(io.spine.server.aggregate.AggregateRepository) Repository(io.spine.server.entity.Repository) ProcessManagerRepository(io.spine.server.procman.ProcessManagerRepository) ProjectionRepository(io.spine.server.projection.ProjectionRepository) BoundedContext(io.spine.server.BoundedContext) Test(org.junit.Test)

Aggregations

Stand (io.spine.server.stand.Stand)7 Test (org.junit.Test)2 Any (com.google.protobuf.Any)1 Query (io.spine.client.Query)1 SubscriptionUpdate (io.spine.client.SubscriptionUpdate)1 Target (io.spine.client.Target)1 BoundedContext (io.spine.server.BoundedContext)1 AggregateRepository (io.spine.server.aggregate.AggregateRepository)1 Repository (io.spine.server.entity.Repository)1 ProcessManagerRepository (io.spine.server.procman.ProcessManagerRepository)1 ProjectionRepository (io.spine.server.projection.ProjectionRepository)1 TypeUrl (io.spine.type.TypeUrl)1