Interface ForwardingMode<T extends Message<?>>

All Known Implementing Classes:
ForwardMatchingInstances, ForwardNone, ForwardToAll

public interface ForwardingMode<T extends Message<?>>
Interface describing the required functionality to forward a message. An example implementation is the ForwardToAll, which forwards all incoming messages.
Since:
3.1
Author:
Steven van Beelen
  • Method Details

    • initialize

      default void initialize(@Nonnull Member member, @Nonnull EntityModel childEntity)
      Initializes an instance of a ForwardingMode.
      Parameters:
      member - The Member to apply a ForwardingMode on. Provided to be able to check for annotations attributes which might assist in the forwarding process.
      childEntity - A EntityModel constructed from the given field.
    • filterCandidates

      <E> Stream<E> filterCandidates(@Nonnull T message, @Nonnull Stream<E> candidates)
      Filter the given Stream of candidates which are to handle the supplied message.
      Type Parameters:
      E - The type of the candidates
      Parameters:
      message - The message of type T to be forwarded.
      candidates - The Stream of candidates to filter.
      Returns:
      a filtered Stream of candidates which will handle the message.