Class RequestMessage<V>
- java.lang.Object
-
- co.paralleluniverse.actors.behaviors.ActorMessage
-
- co.paralleluniverse.actors.behaviors.RequestMessage<V>
-
- Type Parameters:
V- The type of the expected response value
- All Implemented Interfaces:
FromMessage,IdMessage,java.io.Serializable
public abstract class RequestMessage<V> extends ActorMessage implements FromMessage, IdMessage
A message that contains a sender reference (thefromproperty} and a unique identifier (theidproperty) and may be used as a request byRequestReplyHelper.call().- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RequestMessage()Constructs a newRequestMessage.
This constructor may only be used if the message is to be sent viaRequestReplyHelper.call()RequestMessage(ActorRef<?> from)Constructs a newRequestMessage.
This constructor may only be used if the message is to be sent viaRequestReplyHelper.call()RequestMessage(ActorRef<?> from, java.lang.Object id)Constructs a newRequestMessage.RequestMessage(java.lang.Object id)Constructs a newRequestMessage.
This constructor may only be used if the message is to be sent viaRequestReplyHelper.call()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringcontentString()ActorRefgetFrom()The actor that sent the request.java.lang.ObjectgetId()A unique message identifier.-
Methods inherited from class co.paralleluniverse.actors.behaviors.ActorMessage
toString
-
-
-
-
Constructor Detail
-
RequestMessage
@ConstructorParameters({"from","id"}) public RequestMessage(ActorRef<?> from, java.lang.Object id)Constructs a newRequestMessage. If the message is sent viaRequestReplyHelper.call(), both argument may be set tonull, or, preferably, thedefault constructorshould be used instead.- Parameters:
from- the actor sending the request. Usually you should pass the result ofRequestReplyHelper.from().id- a unique message identifier. Usually you should pass the result ofRequestReplyHelper.makeId().
-
RequestMessage
@ConstructorParameters("from") public RequestMessage(ActorRef<?> from)Constructs a newRequestMessage.
This constructor may only be used if the message is to be sent viaRequestReplyHelper.call()- Parameters:
from- the actor sending the request. Usually you should pass the result ofRequestReplyHelper.from().
-
RequestMessage
@ConstructorParameters("id") public RequestMessage(java.lang.Object id)Constructs a newRequestMessage.
This constructor may only be used if the message is to be sent viaRequestReplyHelper.call()- Parameters:
id- a unique message identifier. Usually you should pass the result ofRequestReplyHelper.makeId().
-
RequestMessage
public RequestMessage()
Constructs a newRequestMessage.
This constructor may only be used if the message is to be sent viaRequestReplyHelper.call()
-
-
Method Detail
-
getFrom
public ActorRef getFrom()
The actor that sent the request.- Specified by:
getFromin interfaceFromMessage
-
getId
public java.lang.Object getId()
A unique message identifier.
-
contentString
protected java.lang.String contentString()
- Overrides:
contentStringin classActorMessage
-
-