Package it.tidalwave.actor
Class MessageSupport
- java.lang.Object
-
- it.tidalwave.actor.MessageSupport
-
- All Implemented Interfaces:
Collaboration.Provider,As,java.io.Serializable
- Direct Known Subclasses:
CollaborationCompletedMessage,CollaborationStartedMessage
public abstract class MessageSupport extends java.lang.Object implements Collaboration.Provider, As, java.io.Serializable
A support class for implementing messages.- Author:
- Fabrizio Giudici
- See Also:
- Serialized Form
- Stereotype:
- Message
-
-
Field Summary
Fields Modifier and Type Field Description protected it.tidalwave.actor.impl.DefaultCollaborationcollaboration
-
Constructor Summary
Constructors Modifier Constructor Description protectedMessageSupport()protectedMessageSupport(Collaboration collaboration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CollaborationgetCollaboration()Returns theCollaborationthat this message is part of.<T> java.util.Optional<T>maybeAs(java.lang.Class<? extends T> type)Collaborationsend()Sends this message, eventually performing a replacement (seeMessageDecoratorfor further info).CollaborationsendDirectly()Sends this message directly, not performing any replacement (seeMessageDecoratorfor further info).CollaborationsendLater(int delay, java.util.concurrent.TimeUnit timeUnit)Sends this message after a delay, eventually performing a replacement (seeMessageDecoratorfor further info).
-
-
-
Constructor Detail
-
MessageSupport
protected MessageSupport()
-
MessageSupport
protected MessageSupport(@Nonnull Collaboration collaboration)- Parameters:
collaboration- the collaboration
-
-
Method Detail
-
getCollaboration
@Nonnull public Collaboration getCollaboration()
Returns theCollaborationthat this message is part of.- Specified by:
getCollaborationin interfaceCollaboration.Provider- Returns:
- the
Collaboration
-
send
@Nonnull public Collaboration send()
Sends this message, eventually performing a replacement (seeMessageDecoratorfor further info).- Returns:
- the
Collaborationthat this message is part of
-
sendDirectly
@Nonnull public Collaboration sendDirectly()
Sends this message directly, not performing any replacement (seeMessageDecoratorfor further info).- Returns:
- the
Collaborationthat this message is part of
-
sendLater
@Nonnull public Collaboration sendLater(@Nonnegative int delay, @Nonnull java.util.concurrent.TimeUnit timeUnit)
Sends this message after a delay, eventually performing a replacement (seeMessageDecoratorfor further info).- Parameters:
delay- the delaytimeUnit- theTimeUnitfor the delay- Returns:
- the
Collaborationthat this message is part of
-
-