Class MessageSupport

java.lang.Object
it.tidalwave.actor.MessageSupport
All Implemented Interfaces:
Collaboration.Provider, As, Serializable
Direct Known Subclasses:
CollaborationCompletedMessage, CollaborationStartedMessage

public abstract class MessageSupport extends Object implements Collaboration.Provider, As, Serializable
A support class for implementing messages.
Author:
Fabrizio Giudici
See Also:
Stereotype:
Message
  • Field Details Link icon

    • collaboration Link icon

      @Nonnull protected final it.tidalwave.actor.impl.DefaultCollaboration collaboration
  • Constructor Details Link icon

    • MessageSupport Link icon

      protected MessageSupport()
    • MessageSupport Link icon

      protected MessageSupport(@Nonnull Collaboration collaboration)
      Parameters:
      collaboration - the collaboration
  • Method Details Link icon

    • getCollaboration Link icon

      @Nonnull public Collaboration getCollaboration()
      Returns the Collaboration that this message is part of.
      Specified by:
      getCollaboration in interface Collaboration.Provider
      Returns:
      the Collaboration
    • send Link icon

      @Nonnull public Collaboration send()
      Sends this message, eventually performing a replacement (see MessageDecorator for further info).
      Returns:
      the Collaboration that this message is part of
    • sendDirectly Link icon

      @Nonnull public Collaboration sendDirectly()
      Sends this message directly, not performing any replacement (see MessageDecorator for further info).
      Returns:
      the Collaboration that this message is part of
    • sendLater Link icon

      @Nonnull public Collaboration sendLater(@Nonnegative int delay, @Nonnull TimeUnit timeUnit)
      Sends this message after a delay, eventually performing a replacement (see MessageDecorator for further info).
      Parameters:
      delay - the delay
      timeUnit - the TimeUnit for the delay
      Returns:
      the Collaboration that this message is part of
    • maybeAs Link icon

      @Nonnull public <T> Optional<T> maybeAs(@Nonnull Class<? extends T> type)
      Specified by:
      maybeAs in interface As