io.vlingo.symbio.store.dispatch.ConfirmDispatchedResultInterest Java Examples

The following examples show how to use io.vlingo.symbio.store.dispatch.ConfirmDispatchedResultInterest. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProjectionDispatcherActor.java    From vlingo-lattice with Mozilla Public License 2.0 6 votes vote down vote up
protected ProjectionDispatcherActor(final Collection<ProjectToDescription> projectToDescriptions, final long multiConfirmationsExpiration) {
  super(projectToDescriptions);

  this.interest = selfAs(ConfirmDispatchedResultInterest.class);
  this.projectionControl = new ProjectionControl() {
    @Override
    public void confirmProjected(String projectionId) {
      if (control != null) {
        control.confirmDispatched(projectionId, interest);
      } else if (requiresDispatchedConfirmation()) {
        logger().error("WARNING: ProjectionDispatcher control is not set; unconfirmed: " + projectionId);
      }
    }
  };

  final Protocols protocols =
          childActorFor(
                  new Class[] { MultiConfirming.class, ProjectionControl.class },
                  Definition.has(MultiConfirmingProjectionControlActor.class,
                                 Definition.parameters(projectionControl, multiConfirmationsExpiration)));

  this.multiConfirming = protocols.get(0);
  this.multiConfirmingProjectionControl = protocols.get(1);
}
 
Example #2
Source File: DispatcherControlActor.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void confirmDispatched(final String dispatchId, final ConfirmDispatchedResultInterest interest) {
  try {
    delegate.confirmDispatched(dispatchId);
    interest.confirmDispatchedResultedIn(Result.Success, dispatchId);
  } catch (final Exception e) {
    logger().error(getClass().getSimpleName() + " confirmDispatched() failed because: " + e.getMessage(), e);
    interest.confirmDispatchedResultedIn(Result.Failure, dispatchId);
  }
}
 
Example #3
Source File: MockStateStoreDispatcher.java    From vlingo-symbio with Mozilla Public License 2.0 4 votes vote down vote up
public MockStateStoreDispatcher(final ConfirmDispatchedResultInterest confirmDispatchedResultInterest) {
  this.confirmDispatchedResultInterest = confirmDispatchedResultInterest;
  this.access = AccessSafely.afterCompleting(0);
}
 
Example #4
Source File: DescribedProjection.java    From vlingo-lattice with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public void confirmDispatched(final String dispatchId, final ConfirmDispatchedResultInterest interest) {
  access.writeUsing("count", 1);
}