io.vlingo.common.BasicCompletes Java Examples

The following examples show how to use io.vlingo.common.BasicCompletes. 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: Journal__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 6 votes vote down vote up
@Override
public io.vlingo.common.Completes<io.vlingo.symbio.store.journal.StreamReader<T>> streamReader(final java.lang.String arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<Journal> consumer = (actor) -> actor.streamReader(arg0);
    final io.vlingo.common.Completes<io.vlingo.symbio.store.journal.StreamReader<T>> completes = new BasicCompletes<>(
            actor.scheduler());
    if (mailbox.isPreallocated()) {
      mailbox.send(actor, Journal.class, consumer, Returns.value(completes), streamReaderRepresentation6);
    } else {
      mailbox.send(new LocalMessage<>(actor, Journal.class, consumer, Returns.value(completes), streamReaderRepresentation6));
    }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, streamReaderRepresentation6));
  }
  return null;
}
 
Example #2
Source File: Journal__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 6 votes vote down vote up
@Override
public <ET extends Entry<?>> io.vlingo.common.Completes<io.vlingo.symbio.store.journal.JournalReader<ET>> journalReader(final java.lang.String arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<Journal> consumer = (actor) -> actor.journalReader(arg0);
    final io.vlingo.common.Completes<io.vlingo.symbio.store.journal.JournalReader<ET>> completes = new BasicCompletes<>(
            actor.scheduler());
    if (mailbox.isPreallocated()) {
      mailbox.send(actor, Journal.class, consumer, Returns.value(completes), journalReaderRepresentation5);
    } else {
      mailbox.send(new LocalMessage<>(actor, Journal.class, consumer, Returns.value(completes), journalReaderRepresentation5));
    }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, journalReaderRepresentation5));
  }
  return null;
}
 
Example #3
Source File: Server__Proxy.java    From vlingo-http with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public Completes<Boolean> startUp() {
  if (!actor.isStopped()) {
    final SerializableConsumer<Server> consumer = (actor) -> actor.startUp();
    final Completes<Boolean> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, Server.class, consumer, Returns.value(completes), startUpRepresentation2); }
    else { mailbox.send(new LocalMessage<Server>(actor, Server.class, consumer, Returns.value(completes), startUpRepresentation2)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, startUpRepresentation2));
  }
  return null;
}
 
Example #4
Source File: StateStoreEntryReader__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public Completes<Stream> streamAll() {
  if (!actor.isStopped()) {
    final SerializableConsumer<StateStoreEntryReader> consumer = (actor) -> actor.streamAll();
    final io.vlingo.common.Completes<Stream> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, StateStoreEntryReader.class, consumer, Returns.value(completes), streamAllRepresentation10); }
    else { mailbox.send(new LocalMessage<StateStoreEntryReader>(actor, StateStoreEntryReader.class, consumer, Returns.value(completes), streamAllRepresentation10)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, streamAllRepresentation10));
  }
  return null;
}
 
Example #5
Source File: StateStore__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public <ET extends Entry<?>> Completes<StateStoreEntryReader<ET>> entryReader(String arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<StateStore> consumer = (actor) -> actor.entryReader(arg0);
    final Completes<StateStoreEntryReader<ET>> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, StateStore.class, consumer, Returns.value(completes), entryReaderRepresentation3); }
    else { mailbox.send(new LocalMessage<StateStore>(actor, StateStore.class, consumer, Returns.value(completes), entryReaderRepresentation3)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, entryReaderRepresentation3));
  }
  return null;
}
 
Example #6
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 #7
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 #8
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 #9
Source File: Entity__Proxy.java    From vlingo-lattice with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public io.vlingo.common.Completes<java.lang.String> doTest3() {
  if (!actor.isStopped()) {
    final SerializableConsumer<Entity> consumer = (actor) -> actor.doTest3();
    final io.vlingo.common.Completes<java.lang.String> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, Entity.class, consumer, Returns.value(completes), doTest3Representation3); }
    else { mailbox.send(new LocalMessage<Entity>(actor, Entity.class, consumer, Returns.value(completes), doTest3Representation3)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, doTest3Representation3));
  }
  return null;
}
 
Example #10
Source File: Server__Proxy.java    From vlingo-http with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public Completes<Boolean> shutDown() {
  if (!actor.isStopped()) {
    final SerializableConsumer<Server> consumer = (actor) -> actor.shutDown();
    final Completes<Boolean> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, Server.class, consumer, Returns.value(completes), shutDownRepresentation1); }
    else { mailbox.send(new LocalMessage<Server>(actor, Server.class, consumer, Returns.value(completes), shutDownRepresentation1)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, shutDownRepresentation1));
  }
  return null;
}
 
Example #11
Source File: StateStoreEntryReader__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public io.vlingo.common.Completes<java.lang.String> seekTo(java.lang.String arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<StateStoreEntryReader> consumer = (actor) -> actor.seekTo(arg0);
    final io.vlingo.common.Completes<java.lang.String> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, StateStoreEntryReader.class, consumer, Returns.value(completes), seekToRepresentation9); }
    else { mailbox.send(new LocalMessage<StateStoreEntryReader>(actor, StateStoreEntryReader.class, consumer, Returns.value(completes), seekToRepresentation9)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, seekToRepresentation9));
  }
  return null;
}
 
Example #12
Source File: ClientConsumer__Proxy.java    From vlingo-http with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public Completes<Response> requestWith(io.vlingo.http.Request arg0, io.vlingo.common.Completes<Response> arg1) {
  if (!actor.isStopped()) {
    final SerializableConsumer<ClientConsumer> consumer = (actor) -> actor.requestWith(arg0, arg1);
    final Completes<Response> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, ClientConsumer.class, consumer, Returns.value(completes), requestWithRepresentation1); }
    else { mailbox.send(new LocalMessage<ClientConsumer>(actor, ClientConsumer.class, consumer, Returns.value(completes), requestWithRepresentation1)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, requestWithRepresentation1));
  }
  return null;
}
 
Example #13
Source File: User__Proxy.java    From vlingo-http with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public Completes<State> withContact(io.vlingo.http.sample.user.model.Contact arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<User> consumer = (actor) -> actor.withContact(arg0);
    final Completes<State> completes = new BasicCompletes<>(actor.scheduler());
    mailbox.send(new LocalMessage<User>(actor, User.class, consumer, Returns.value(completes), withContactRepresentation1));
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, withContactRepresentation1));
  }
  return null;
}
 
Example #14
Source File: User__Proxy.java    From vlingo-http with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public Completes<State> withName(io.vlingo.http.sample.user.model.Name arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<User> consumer = (actor) -> actor.withName(arg0);
    final Completes<State> completes = new BasicCompletes<>(actor.scheduler());
    mailbox.send(new LocalMessage<User>(actor, User.class, consumer, Returns.value(completes), withNameRepresentation2));
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, withNameRepresentation2));
  }
  return null;
}
 
Example #15
Source File: User__Proxy.java    From vlingo-examples with Mozilla Public License 2.0 5 votes vote down vote up
public Completes<UserState> withContact(Contact arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<User> consumer = (actor) -> actor.withContact(arg0);
    final Completes<UserState> completes = new BasicCompletes<>(actor.scheduler());
    mailbox.send(new LocalMessage<User>(actor, User.class, consumer, Returns.value(completes), withContactRepresentation2));
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, withContactRepresentation2));
  }
  return null;
}
 
Example #16
Source File: User__Proxy.java    From vlingo-examples with Mozilla Public License 2.0 5 votes vote down vote up
public Completes<UserState> withName(Name arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<User> consumer = (actor) -> actor.withName(arg0);
    final Completes<UserState> completes = new BasicCompletes<>(actor.scheduler());
    mailbox.send(new LocalMessage<User>(actor, User.class, consumer, Returns.value(completes), withNameRepresentation3));
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, withNameRepresentation3));
  }
  return null;
}
 
Example #17
Source File: Queries__Proxy.java    From vlingo-examples with Mozilla Public License 2.0 5 votes vote down vote up
public Completes<ProfileData> profileOf(java.lang.String arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<Queries> consumer = (actor) -> actor.profileOf(arg0);
    final Completes<io.vlingo.frontservice.data.ProfileData> completes = new BasicCompletes<>(actor.scheduler());
    mailbox.send(new LocalMessage<Queries>(actor, Queries.class, consumer, Returns.value(completes), profileOfRepresentation1));
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, profileOfRepresentation1));
  }
  return null;
}
 
Example #18
Source File: Queries__Proxy.java    From vlingo-examples with Mozilla Public License 2.0 5 votes vote down vote up
public Completes<UserData> userDataOf(java.lang.String arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<Queries> consumer = (actor) -> actor.userDataOf(arg0);
    final Completes<io.vlingo.frontservice.data.UserData> completes = new BasicCompletes<>(actor.scheduler());
    mailbox.send(new LocalMessage<Queries>(actor, Queries.class, consumer, Returns.value(completes), userDataOfRepresentation2));
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, userDataOfRepresentation2));
  }
  return null;
}
 
Example #19
Source File: Queries__Proxy.java    From vlingo-examples with Mozilla Public License 2.0 5 votes vote down vote up
public Completes<Collection<UserData>> usersData() {
  if (!actor.isStopped()) {
    final SerializableConsumer<Queries> consumer = (actor) -> actor.usersData();
    final Completes<Collection<UserData>> completes = new BasicCompletes<>(actor.scheduler());
    mailbox.send(new LocalMessage<Queries>(actor, Queries.class, consumer, Returns.value(completes), usersDataRepresentation3));
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, usersDataRepresentation3));
  }
  return null;
}
 
Example #20
Source File: JournalReader__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
@SuppressWarnings("rawtypes")
public Completes<Long> size() {
  if (!actor.isStopped()) {
    final SerializableConsumer<JournalReader> consumer = (actor) -> actor.size();
    final io.vlingo.common.Completes<Long> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, JournalReader.class, consumer, Returns.value(completes), sizeRepresentation6); }
    else { mailbox.send(new LocalMessage<JournalReader>(actor, JournalReader.class, consumer, Returns.value(completes), sizeRepresentation6)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, sizeRepresentation6));
  }
  return null;
}
 
Example #21
Source File: StreamReader__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<io.vlingo.symbio.store.journal.EntityStream<T>> streamFor(java.lang.String arg0, int arg1) {
  if (!actor.isStopped()) {
    final SerializableConsumer<StreamReader> consumer = (actor) -> actor.streamFor(arg0, arg1);
    final io.vlingo.common.Completes<io.vlingo.symbio.store.journal.EntityStream<T>> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, StreamReader.class, consumer, Returns.value(completes), streamForRepresentation2); }
    else { mailbox.send(new LocalMessage<StreamReader>(actor, StreamReader.class, consumer, Returns.value(completes), streamForRepresentation2)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, streamForRepresentation2));
  }
  return null;
}
 
Example #22
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;
}
 
Example #23
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> seekTo(java.lang.String arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<JournalReader> consumer = (actor) -> actor.seekTo(arg0);
    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), seekToRepresentation3); }
    else { mailbox.send(new LocalMessage<JournalReader>(actor, JournalReader.class, consumer, Returns.value(completes), seekToRepresentation3)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, seekToRepresentation3));
  }
  return null;
}
 
Example #24
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<T> readNext() {
  if (!actor.isStopped()) {
    final SerializableConsumer<JournalReader> consumer = (actor) -> actor.readNext();
    final io.vlingo.common.Completes<T> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, JournalReader.class, consumer, Returns.value(completes), readNextRepresentation4); }
    else { mailbox.send(new LocalMessage<JournalReader>(actor, JournalReader.class, consumer, Returns.value(completes), readNextRepresentation4)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, readNextRepresentation4));
  }
  return null;
}
 
Example #25
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<T> readNext(final String fromId) {
  if (!actor.isStopped()) {
    final SerializableConsumer<JournalReader> consumer = (actor) -> actor.readNext(fromId);
    final io.vlingo.common.Completes<T> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, JournalReader.class, consumer, Returns.value(completes), readNextRepresentation4); }
    else { mailbox.send(new LocalMessage<JournalReader>(actor, JournalReader.class, consumer, Returns.value(completes), readNextRepresentation4)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, readNextRepresentation4));
  }
  return null;
}
 
Example #26
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.util.List<T>> readNext(int arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<JournalReader> consumer = (actor) -> actor.readNext(arg0);
    final io.vlingo.common.Completes<java.util.List<T>> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, JournalReader.class, consumer, Returns.value(completes), readNextRepresentation5); }
    else { mailbox.send(new LocalMessage<JournalReader>(actor, JournalReader.class, consumer, Returns.value(completes), readNextRepresentation5)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, readNextRepresentation5));
  }
  return null;
}
 
Example #27
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.util.List<T>> readNext(final String fromId, int arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<JournalReader> consumer = (actor) -> actor.readNext(fromId, arg0);
    final io.vlingo.common.Completes<java.util.List<T>> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, JournalReader.class, consumer, Returns.value(completes), readNextRepresentation5); }
    else { mailbox.send(new LocalMessage<JournalReader>(actor, JournalReader.class, consumer, Returns.value(completes), readNextRepresentation5)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, readNextRepresentation5));
  }
  return null;
}
 
Example #28
Source File: StreamReader__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<io.vlingo.symbio.store.journal.EntityStream<T>> streamFor(java.lang.String arg0) {
  if (!actor.isStopped()) {
    final SerializableConsumer<StreamReader> consumer = (actor) -> actor.streamFor(arg0);
    final io.vlingo.common.Completes<io.vlingo.symbio.store.journal.EntityStream<T>> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, StreamReader.class, consumer, Returns.value(completes), streamForRepresentation1); }
    else { mailbox.send(new LocalMessage<StreamReader>(actor, StreamReader.class, consumer, Returns.value(completes), streamForRepresentation1)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, streamForRepresentation1));
  }
  return null;
}
 
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 Completes<Stream> streamAll() {
  if (!actor.isStopped()) {
    final SerializableConsumer<JournalReader> consumer = (actor) -> actor.streamAll();
    final io.vlingo.common.Completes<Stream> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, JournalReader.class, consumer, Returns.value(completes), sizeRepresentation7); }
    else { mailbox.send(new LocalMessage<JournalReader>(actor, JournalReader.class, consumer, Returns.value(completes), sizeRepresentation7)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, sizeRepresentation7));
  }
  return null;
}
 
Example #30
Source File: StateStoreEntryReader__Proxy.java    From vlingo-symbio with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public io.vlingo.common.Completes<java.lang.String> name() {
  if (!actor.isStopped()) {
    final SerializableConsumer<StateStoreEntryReader> consumer = (actor) -> actor.name();
    final io.vlingo.common.Completes<java.lang.String> completes = new BasicCompletes<>(actor.scheduler());
    if (mailbox.isPreallocated()) { mailbox.send(actor, StateStoreEntryReader.class, consumer, Returns.value(completes), nameRepresentation1); }
    else { mailbox.send(new LocalMessage<StateStoreEntryReader>(actor, StateStoreEntryReader.class, consumer, Returns.value(completes), nameRepresentation1)); }
    return completes;
  } else {
    actor.deadLetters().failedDelivery(new DeadLetter(actor, nameRepresentation1));
  }
  return null;
}