aa.core
Class ActorMessage

java.lang.Object
  extended byaa.core.ActorMessage
All Implemented Interfaces:
java.io.Serializable

public class ActorMessage
extends java.lang.Object
implements java.io.Serializable

This class specifies a communication message between actors.

History:

Version:
$Date: 2008/01/01 00:23:48 $ $Revision: 1.1 $
Author:
Myeong-Wuk Jang
See Also:
Serialized Form

Field Summary
private  ActorName m_anReceiver
           
private  ActorName m_anSender
           
private  boolean m_bErrorMessage
           
private  boolean m_bReturnMessage
           
private  boolean m_bReturnRequest
           
private  java.lang.Object[] m_objaArgs
           
private  java.lang.String m_strComments
           
private  java.lang.String m_strDestHostAddress
           
private  java.lang.String m_strErrorMessage
           
private  java.lang.String m_strMethod
           
private  java.lang.String m_strReplyTo
           
private  java.lang.String m_strReplyWith
           
 
Constructor Summary
ActorMessage(ActorName p_anSender, ActorName p_anReceiver, java.lang.String p_strMethod, java.lang.Object[] p_objaArgs, boolean p_bReturnRequest)
          Creates an actor communication message.
 
Method Summary
 java.lang.Object[] getArguments()
          Returns arguments of the method.
 java.lang.String getDestHostAddress()
          Returns the Internet address of the destination host.
 java.lang.String getErrorMessage()
          Returns an error message.
 java.lang.String getMethod()
          Returns the method name.
 ActorName getReceiver()
          Returns the name of the receiver actor.
 java.lang.String getReplyWith()
          Returns the strRepyWith value.
 ActorName getSender()
          Returns the name of the sender actor.
 boolean isErrorMessage()
          Checkes if this is an error message.
 boolean isReturnMessage()
          Checkes if this is a return message.
 boolean isReturnRequested()
          Checkes if the ruturn message is required.
 ActorMessage makeErrorMessage(ActorName p_anSender, java.lang.String p_strErrorMsg)
          Create an error message.
 ActorMessage makeErrorMessage(java.lang.String p_strErrorMsg)
          Create an error message.
 ActorMessage makeReturnMessage(java.lang.Object p_objReply)
          Creates a return message.
 void setComments(java.lang.String p_strComments)
          Sets comments of this message.
 void setDestHostAddress(java.lang.String p_strDestHostAddress)
          Sets the Internet address of the destination host.
 void setErrorMessage(java.lang.String p_strMsg)
          Sets an error message.
 void setReplyTo(java.lang.String p_strMsgID)
          Sets the identifier of the original message.
 void setReturnMessage(java.lang.Object p_objReturn)
          Initialize the return value of a call message.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_anSender

private ActorName m_anSender

m_anReceiver

private ActorName m_anReceiver

m_strMethod

private java.lang.String m_strMethod

m_objaArgs

private java.lang.Object[] m_objaArgs

m_bReturnRequest

private boolean m_bReturnRequest

m_strReplyWith

private java.lang.String m_strReplyWith

m_strReplyTo

private java.lang.String m_strReplyTo

m_strComments

private java.lang.String m_strComments

m_strErrorMessage

private java.lang.String m_strErrorMessage

m_strDestHostAddress

private java.lang.String m_strDestHostAddress

m_bReturnMessage

private boolean m_bReturnMessage

m_bErrorMessage

private boolean m_bErrorMessage
Constructor Detail

ActorMessage

public ActorMessage(ActorName p_anSender,
                    ActorName p_anReceiver,
                    java.lang.String p_strMethod,
                    java.lang.Object[] p_objaArgs,
                    boolean p_bReturnRequest)
Creates an actor communication message.

Parameters:
p_anSender - the name of the sender actor.
p_anReceiver - the name of the receiver actor.
p_strMethod - the name of the method to be called.
p_objaArgs - an array of argument objects.
p_bReturnRequest - the flag to request the return value.
Method Detail

getSender

public final ActorName getSender()
Returns the name of the sender actor.

Returns:
the name of the sender actor.

getReceiver

public final ActorName getReceiver()
Returns the name of the receiver actor.

Returns:
the name of the receiver actor.

setDestHostAddress

public void setDestHostAddress(java.lang.String p_strDestHostAddress)
Sets the Internet address of the destination host.

Parameters:
p_strDestHostAddress - the Internet address of the destination host of this message.

getDestHostAddress

public final java.lang.String getDestHostAddress()
Returns the Internet address of the destination host.

Returns:
the Internet address of the destination host.

getMethod

public final java.lang.String getMethod()
Returns the method name.

Returns:
the metond name.

getArguments

public final java.lang.Object[] getArguments()
Returns arguments of the method.

Returns:
arguments of the method.

isReturnRequested

public boolean isReturnRequested()
Checkes if the ruturn message is required.


setReturnMessage

public void setReturnMessage(java.lang.Object p_objReturn)
Initialize the return value of a call message.

Parameters:
p_objReturn - the return value of a call message.

isReturnMessage

public boolean isReturnMessage()
Checkes if this is a return message.


setErrorMessage

public void setErrorMessage(java.lang.String p_strMsg)
Sets an error message.

Parameters:
p_strMsg - an error message.

getErrorMessage

public final java.lang.String getErrorMessage()
Returns an error message.

Returns:
an error message.

isErrorMessage

public boolean isErrorMessage()
Checkes if this is an error message.


getReplyWith

public final java.lang.String getReplyWith()
Returns the strRepyWith value.

Returns:
the strRepyWith value.

setReplyTo

public void setReplyTo(java.lang.String p_strMsgID)
Sets the identifier of the original message.

Parameters:
p_strMsgID - the identifier of the original message.

setComments

public void setComments(java.lang.String p_strComments)
Sets comments of this message.

Parameters:
p_strComments - comments of this message.

makeReturnMessage

public ActorMessage makeReturnMessage(java.lang.Object p_objReply)
Creates a return message.

Parameters:
p_objReply - the refrence to an object, a return value.
Returns:
a return message of this message.

makeErrorMessage

public ActorMessage makeErrorMessage(java.lang.String p_strErrorMsg)
Create an error message.

Parameters:
p_strErrorMsg - an error message.
Returns:
a return message of this message.

makeErrorMessage

public ActorMessage makeErrorMessage(ActorName p_anSender,
                                     java.lang.String p_strErrorMsg)
Create an error message.

Parameters:
p_anSender - the name of the sender actor of this message.
p_strErrorMsg - an error message.
Returns:
a return message of this message.

toString

public java.lang.String toString()
Returns a string representation of this object.

Returns:
a string representation of this object.