io.vlingo.actors.DeadLetter Java Examples

The following examples show how to use io.vlingo.actors.DeadLetter. 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: PurchaseAgent.java    From vlingo-examples with Mozilla Public License 2.0 6 votes vote down vote up
@Override
public void placeOrder( Order order )
{
    if ( order.isExpired() )
    {
        this.deadLetters().failedDelivery( new DeadLetter( this, "stop()" ));
        results.access.writeUsing("afterOrderExpiredCount", 1);
        logger().debug( String.format( "PurchaseAgent: delivered expired %s to dead letters", order ));
    }
    else
    {
        results.access.writeUsing("afterOrderPlacedCount", 1);
        logger().debug( String.format( "PurchaseAgent: placing order for %s", order ));
    }

}
 
Example #2
Source File: Space__Proxy.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public <T>io.vlingo.common.Completes<io.vlingo.lattice.grid.spaces.KeyItem<T>> put(io.vlingo.lattice.grid.spaces.Key arg0, io.vlingo.lattice.grid.spaces.Item<T> arg1) {
  if (!actor.isStopped()) {
    ActorProxyBase<Space> self = this;
    final SerializableConsumer<Space> consumer = (actor) -> actor.put(ActorProxyBase.thunk(self, (Actor)actor, arg0), ActorProxyBase.thunk(self, (Actor)actor, arg1));
    final io.vlingo.common.Completes<io.vlingo.lattice.grid.spaces.KeyItem<T>> returnValue = Completes.using(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, Space.class, consumer, Returns.value(returnValue), putRepresentation2); }
    else { mailbox.send(new LocalMessage<Space>(actor, Space.class, consumer, Returns.value(returnValue), putRepresentation2)); }
    return returnValue;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, putRepresentation2));
  }
  return null;
}
 
Example #3
Source File: StateStore__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public Completes<Stream> streamSomeUsing(final QueryExpression query) {
  if (!actor.isStopped()) {
    final SerializableConsumer<StateStore> consumer = (actor) -> actor.streamSomeUsing(query);
    final Completes<Stream> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, StateStore.class, consumer, Returns.value(completes), streamSomeUsingRepresentation5); }
    else { mailbox.send(new LocalMessage<StateStore>(actor, StateStore.class, consumer, Returns.value(completes), streamSomeUsingRepresentation5)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, streamSomeUsingRepresentation5));
  }
  return null;
}
 
Example #4
Source File: ObjectStoreWriterPersistResultInterest__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void persistResultedIn(io.vlingo.common.Outcome<io.vlingo.symbio.store.StorageException, io.vlingo.symbio.store.Result> arg0, java.lang.Object arg1, int arg2, int arg3, java.lang.Object arg4) {
  if (!actor.isStopped()) {
    final SerializableConsumer<PersistResultInterest> consumer = (actor) -> actor.persistResultedIn(arg0, arg1, arg2, arg3, arg4);
    if (mailbox.isPreallocated()) { mailbox.send(actor, PersistResultInterest.class, consumer, null, persistResultedInRepresentation1); }
    else { mailbox.send(new LocalMessage<PersistResultInterest>(actor, PersistResultInterest.class, consumer, persistResultedInRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, persistResultedInRepresentation1));
  }
}
 
Example #5
Source File: ObjectStoreReaderQueryResultInterest__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void queryAllResultedIn(io.vlingo.common.Outcome<io.vlingo.symbio.store.StorageException, io.vlingo.symbio.store.Result> arg0, io.vlingo.symbio.store.object.ObjectStoreReader.QueryMultiResults arg1, java.lang.Object arg2) {
  if (!actor.isStopped()) {
    final SerializableConsumer<QueryResultInterest> consumer = (actor) -> actor.queryAllResultedIn(arg0, arg1, arg2);
    if (mailbox.isPreallocated()) { mailbox.send(actor, QueryResultInterest.class, consumer, null, queryAllResultedInRepresentation1); }
    else { mailbox.send(new LocalMessage<QueryResultInterest>(actor, QueryResultInterest.class, consumer, queryAllResultedInRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, queryAllResultedInRepresentation1));
  }
}
 
Example #6
Source File: ObjectStoreReaderQueryResultInterest__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void queryObjectResultedIn(io.vlingo.common.Outcome<io.vlingo.symbio.store.StorageException, io.vlingo.symbio.store.Result> arg0, io.vlingo.symbio.store.object.ObjectStoreReader.QuerySingleResult arg1, java.lang.Object arg2) {
  if (!actor.isStopped()) {
    final SerializableConsumer<QueryResultInterest> consumer = (actor) -> actor.queryObjectResultedIn(arg0, arg1, arg2);
    if (mailbox.isPreallocated()) { mailbox.send(actor, QueryResultInterest.class, consumer, null, queryObjectResultedInRepresentation2); }
    else { mailbox.send(new LocalMessage<QueryResultInterest>(actor, QueryResultInterest.class, consumer, queryObjectResultedInRepresentation2)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, queryObjectResultedInRepresentation2));
  }
}
 
Example #7
Source File: ObjectStore__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public Completes<EntryReader<? extends Entry<?>>> entryReader(final String arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<ObjectStore> consumer = (actor) -> actor.entryReader(arg0);
    final Completes<EntryReader<? extends Entry<?>>> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, ObjectStore.class, consumer, Returns.value(completes), entryReaderRepresentation2); }
    else { mailbox.send(new LocalMessage<ObjectStore>(actor, ObjectStore.class, consumer, Returns.value(completes), entryReaderRepresentation2)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, entryReaderRepresentation2));
  }
  return null;
}
 
Example #8
Source File: ObjectStore__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
private void send(final String representation, final SerializableConsumer<ObjectStore> consumer) {
  if (!actor.isStopped()) {
    if (mailbox.isPreallocated()) {
      mailbox.send(actor, ObjectStore.class, consumer, null, representation);
    } else {
      mailbox.send(new LocalMessage<>(actor, ObjectStore.class, consumer, representation));
    }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, representation));
  }
}
 
Example #9
Source File: ObjectStoreQueryResultInterest__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void queryAllResultedIn(io.vlingo.common.Outcome<io.vlingo.symbio.store.StorageException, io.vlingo.symbio.store.Result> arg0, io.vlingo.symbio.store.object.ObjectStore.QueryMultiResults arg1, java.lang.Object arg2) {
  if (!actor.isStopped()) {
    final SerializableConsumer<QueryResultInterest> consumer = (actor) -> actor.queryAllResultedIn(arg0, arg1, arg2);
    if (mailbox.isPreallocated()) { mailbox.send(actor, QueryResultInterest.class, consumer, null, queryAllResultedInRepresentation1); }
    else { mailbox.send(new LocalMessage<QueryResultInterest>(actor, QueryResultInterest.class, consumer, queryAllResultedInRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, queryAllResultedInRepresentation1));
  }
}
 
Example #10
Source File: ObjectStoreQueryResultInterest__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void queryObjectResultedIn(io.vlingo.common.Outcome<io.vlingo.symbio.store.StorageException, io.vlingo.symbio.store.Result> arg0, io.vlingo.symbio.store.object.ObjectStore.QuerySingleResult arg1, java.lang.Object arg2) {
  if (!actor.isStopped()) {
    final SerializableConsumer<QueryResultInterest> consumer = (actor) -> actor.queryObjectResultedIn(arg0, arg1, arg2);
    if (mailbox.isPreallocated()) { mailbox.send(actor, QueryResultInterest.class, consumer, null, queryObjectResultedInRepresentation2); }
    else { mailbox.send(new LocalMessage<QueryResultInterest>(actor, QueryResultInterest.class, consumer, queryObjectResultedInRepresentation2)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, queryObjectResultedInRepresentation2));
  }
}
 
Example #11
Source File: ObjectStorePersistResultInterest__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void persistResultedIn(Outcome<StorageException, Result> arg0, java.lang.Object arg1, int arg2, int arg3, Object arg4) {
  if (!actor.isStopped()) {
    final SerializableConsumer<PersistResultInterest> consumer = (actor) -> actor.persistResultedIn(arg0, arg1, arg2, arg3, arg4);
    if (mailbox.isPreallocated()) { mailbox.send(actor, PersistResultInterest.class, consumer, null, persistResultedInRepresentation1); }
    else { mailbox.send(new LocalMessage<PersistResultInterest>(actor, PersistResultInterest.class, consumer, persistResultedInRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, persistResultedInRepresentation1));
  }
}
 
Example #12
Source File: ConfirmDispatchedResultInterest__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
public void confirmDispatchedResultedIn(io.vlingo.symbio.store.Result arg0, java.lang.String arg1) {
  if (!actor.isStopped()) {
    final SerializableConsumer<ConfirmDispatchedResultInterest> consumer = (actor) -> actor.confirmDispatchedResultedIn(arg0, arg1);
    if (mailbox.isPreallocated()) { mailbox.send(actor, ConfirmDispatchedResultInterest.class, consumer, null, confirmDispatchedResultedInRepresentation1); }
    else { mailbox.send(new LocalMessage<ConfirmDispatchedResultInterest>(actor, ConfirmDispatchedResultInterest.class, consumer, confirmDispatchedResultedInRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, confirmDispatchedResultedInRepresentation1));
  }
}
 
Example #13
Source File: Dispatcher__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
private void send(final SerializableConsumer<Dispatcher> consumer, final String representation) {
  if (!actor.isStopped()) {
    if (mailbox.isPreallocated()) {
      mailbox.send(actor, Dispatcher.class, consumer, null, representation);
    } else {
      mailbox.send(new LocalMessage<>(actor, Dispatcher.class, consumer, representation));
    }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, representation));
  }
}
 
Example #14
Source File: DispatcherControl__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
private void send(final SerializableConsumer<DispatcherControl> consumer, final String representation) {
  if (!actor.isStopped()) {
    if (mailbox.isPreallocated()) {
      mailbox.send(actor, DispatcherControl.class, consumer, null, representation);
    } else {
      mailbox.send(new LocalMessage<>(actor, DispatcherControl.class, consumer, representation));
    }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, representation));
  }
}
 
Example #15
Source File: Space__Proxy.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public <T>io.vlingo.common.Completes<java.util.Optional<io.vlingo.lattice.grid.spaces.KeyItem<T>>> get(io.vlingo.lattice.grid.spaces.Key arg0, io.vlingo.lattice.grid.spaces.Period arg1) {
  if (!actor.isStopped()) {
    ActorProxyBase<Space> self = this;
    final SerializableConsumer<Space> consumer = (actor) -> actor.get(ActorProxyBase.thunk(self, (Actor)actor, arg0), ActorProxyBase.thunk(self, (Actor)actor, arg1));
    final io.vlingo.common.Completes<java.util.Optional<io.vlingo.lattice.grid.spaces.KeyItem<T>>> returnValue = Completes.using(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, Space.class, consumer, Returns.value(returnValue), getRepresentation1); }
    else { mailbox.send(new LocalMessage<Space>(actor, Space.class, consumer, Returns.value(returnValue), getRepresentation1)); }
    return returnValue;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, getRepresentation1));
  }
  return null;
}
 
Example #16
Source File: StateStore__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public Completes<Stream> streamAllOf(final Class<?> stateType) {
  if (!actor.isStopped()) {
    final SerializableConsumer<StateStore> consumer = (actor) -> actor.streamAllOf(stateType);
    final Completes<Stream> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, StateStore.class, consumer, Returns.value(completes), streamAllOfRepresentation4); }
    else { mailbox.send(new LocalMessage<StateStore>(actor, StateStore.class, consumer, Returns.value(completes), streamAllOfRepresentation4)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, streamAllOfRepresentation4));
  }
  return null;
}
 
Example #17
Source File: Space__Proxy.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public <T>io.vlingo.common.Completes<java.util.Optional<io.vlingo.lattice.grid.spaces.KeyItem<T>>> take(io.vlingo.lattice.grid.spaces.Key arg0, io.vlingo.lattice.grid.spaces.Period arg1) {
  if (!actor.isStopped()) {
    ActorProxyBase<Space> self = this;
    final SerializableConsumer<Space> consumer = (actor) -> actor.take(ActorProxyBase.thunk(self, (Actor)actor, arg0), ActorProxyBase.thunk(self, (Actor)actor, arg1));
    final io.vlingo.common.Completes<java.util.Optional<io.vlingo.lattice.grid.spaces.KeyItem<T>>> returnValue = Completes.using(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, Space.class, consumer, Returns.value(returnValue), takeRepresentation3); }
    else { mailbox.send(new LocalMessage<Space>(actor, Space.class, consumer, Returns.value(returnValue), takeRepresentation3)); }
    return returnValue;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, takeRepresentation3));
  }
  return null;
}
 
Example #18
Source File: Space__Proxy.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public <T>io.vlingo.common.Completes<T> itemFor(java.lang.Class<T> arg0, java.lang.Class<? extends io.vlingo.actors.Actor> arg1, java.lang.Object... arg2) {
  if (!actor.isStopped()) {
    ActorProxyBase<Space> self = this;
    final SerializableConsumer<Space> consumer = (actor) -> actor.itemFor(ActorProxyBase.thunk(self, (Actor)actor, arg0), ActorProxyBase.thunk(self, (Actor)actor, arg1), ActorProxyBase.thunk(self, (Actor)actor, arg2));
    final io.vlingo.common.Completes<T> returnValue = Completes.using(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, Space.class, consumer, Returns.value(returnValue), itemForRepresentation4); }
    else { mailbox.send(new LocalMessage<Space>(actor, Space.class, consumer, Returns.value(returnValue), itemForRepresentation4)); }
    return returnValue;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, itemForRepresentation4));
  }
  return null;
}
 
Example #19
Source File: Feeder__Proxy.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void feedItemTo(io.vlingo.lattice.exchange.feed.FeedItemId arg0, io.vlingo.lattice.exchange.feed.FeedConsumer arg1) {
  if (!actor.isStopped()) {
    final SerializableConsumer<Feeder> consumer = (actor) -> actor.feedItemTo(arg0, arg1);
    if (mailbox.isPreallocated()) { mailbox.send(actor, Feeder.class, consumer, null, feedItemToRepresentation1); }
    else { mailbox.send(new LocalMessage<Feeder>(actor, Feeder.class, consumer, feedItemToRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, feedItemToRepresentation1));
  }
}
 
Example #20
Source File: ProjectionControl__Proxy.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void confirmProjected(java.lang.String arg0) {
  if (!actor.isStopped()) {
    ActorProxyBase<ProjectionControl> self = this;
    final SerializableConsumer<ProjectionControl> consumer = (actor) -> actor.confirmProjected(ActorProxyBase.thunk(self, (Actor)actor, arg0));
    if (mailbox.isPreallocated()) { mailbox.send(actor, ProjectionControl.class, consumer, null, confirmProjectedRepresentation1); }
    else { mailbox.send(new LocalMessage<ProjectionControl>(actor, ProjectionControl.class, consumer, confirmProjectedRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, confirmProjectedRepresentation1));
  }
}
 
Example #21
Source File: Projection__Proxy.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
public void projectWith(io.vlingo.lattice.model.projection.Projectable arg0, io.vlingo.lattice.model.projection.ProjectionControl arg1) {
  if (!actor.isStopped()) {
    final SerializableConsumer<Projection> consumer = (actor) -> actor.projectWith(arg0, arg1);
    if (mailbox.isPreallocated()) { mailbox.send(actor, Projection.class, consumer, null, projectWithRepresentation1); }
    else { mailbox.send(new LocalMessage<Projection>(actor, Projection.class, consumer, projectWithRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, projectWithRepresentation1));
  }
}
 
Example #22
Source File: ProjectionDispatcher__Proxy.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
public void projectTo(io.vlingo.lattice.model.projection.Projection arg0, java.lang.String[] arg1) {
  if (!actor.isStopped()) {
    final SerializableConsumer<ProjectionDispatcher> consumer = (actor) -> actor.projectTo(arg0, arg1);
    if (mailbox.isPreallocated()) { mailbox.send(actor, ProjectionDispatcher.class, consumer, null, projectToRepresentation1); }
    else { mailbox.send(new LocalMessage<ProjectionDispatcher>(actor, ProjectionDispatcher.class, consumer, projectToRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, projectToRepresentation1));
  }
}
 
Example #23
Source File: ResourceRequestHandler__Proxy.java    From vlingo-http with Mozilla Public License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public void handleFor(io.vlingo.http.Context arg0, java.util.function.Consumer arg1) {
  if (!actor.isStopped()) {
    final SerializableConsumer<ResourceRequestHandler> consumer = (actor) -> actor.handleFor(arg0, arg1);
    if (mailbox.isPreallocated()) { mailbox.send(actor, ResourceRequestHandler.class, consumer, null, handleForRepresentation1); }
    else { mailbox.send(new LocalMessage<ResourceRequestHandler>(actor, ResourceRequestHandler.class, consumer, handleForRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, handleForRepresentation1));
  }
}
 
Example #24
Source File: ResourceRequestHandler__Proxy.java    From vlingo-http with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void handleFor(final Context arg0, final MappedParameters arg1, final RequestHandler arg2) {
  if (!actor.isStopped()) {
    final SerializableConsumer<ResourceRequestHandler> consumer = (actor) -> actor.handleFor(arg0, arg1, arg2);
    if (mailbox.isPreallocated()) { mailbox.send(actor, ResourceRequestHandler.class, consumer, null, handleForRepresentation2); }
    else { mailbox.send(new LocalMessage<ResourceRequestHandler>(actor, ResourceRequestHandler.class, consumer, handleForRepresentation2)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, handleForRepresentation2));
  }
}
 
Example #25
Source File: FeedProducer__Proxy.java    From vlingo-http with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void produceFeedFor(io.vlingo.http.resource.feed.FeedProductRequest arg0) {
  if (!actor.isStopped()) {
    ActorProxyBase<FeedProducer> self = this;
    final SerializableConsumer<FeedProducer> consumer = (actor) -> actor.produceFeedFor(ActorProxyBase.thunk(self, (Actor)actor, arg0));
    if (mailbox.isPreallocated()) { mailbox.send(actor, FeedProducer.class, consumer, null, produceFeedForRepresentation1); }
    else { mailbox.send(new LocalMessage<FeedProducer>(actor, FeedProducer.class, consumer, produceFeedForRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, produceFeedForRepresentation1));
  }
}
 
Example #26
Source File: SseFeed__Proxy.java    From vlingo-http with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void to(java.util.Collection<io.vlingo.http.resource.sse.SseSubscriber> arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<SseFeed> consumer = (actor) -> actor.to(arg0);
    if (mailbox.isPreallocated()) { mailbox.send(actor, SseFeed.class, consumer, null, toRepresentation1); }
    else { mailbox.send(new LocalMessage<SseFeed>(actor, SseFeed.class, consumer, toRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, toRepresentation1));
  }
}
 
Example #27
Source File: Scheduled__Proxy.java    From vlingo-actors with Mozilla Public License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public void intervalSignal(io.vlingo.common.Scheduled<T> arg0, T arg1) {
  if (!actor.isStopped()) {
    final SerializableConsumer<Scheduled> consumer = (actor) -> actor.intervalSignal(arg0, arg1);
    if (mailbox.isPreallocated()) { mailbox.send(actor, Scheduled.class, consumer, null, intervalSignalRepresentation1); }
    else { mailbox.send(new LocalMessage<Scheduled>(actor, Scheduled.class, consumer, intervalSignalRepresentation1)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, intervalSignalRepresentation1));
  }
}
 
Example #28
Source File: StateStoreEntryReader__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void close() {
  if (!actor.isStopped()) {
    final SerializableConsumer<StateStoreEntryReader> consumer = (actor) -> actor.close();
    if (mailbox.isPreallocated()) { mailbox.send(actor, StateStoreEntryReader.class, consumer, null, closeRepresentation3); }
    else { mailbox.send(new LocalMessage<StateStoreEntryReader>(actor, StateStoreEntryReader.class, consumer, closeRepresentation3)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, closeRepresentation3));
  }
}
 
Example #29
Source File: JournalReader__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public void close() {
  if (!actor.isStopped()) {
    final SerializableConsumer<JournalReader> consumer = (actor) -> actor.close();
    if (mailbox.isPreallocated()) { mailbox.send(actor, JournalReader.class, consumer, null, nameRepresentation0); }
    else { mailbox.send(new LocalMessage<JournalReader>(actor, JournalReader.class, consumer, null, nameRepresentation0)); }
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, nameRepresentation0));
  }
}
 
Example #30
Source File: JournalReader__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public io.vlingo.common.Completes<java.lang.String> name() {
  if (!actor.isStopped()) {
    final SerializableConsumer<JournalReader> consumer = (actor) -> actor.name();
    final io.vlingo.common.Completes<java.lang.String> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, JournalReader.class, consumer, Returns.value(completes), nameRepresentation1); }
    else { mailbox.send(new LocalMessage<JournalReader>(actor, JournalReader.class, consumer, Returns.value(completes), nameRepresentation1)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, nameRepresentation1));
  }
  return null;
}