nathan.middleware
Class Message

java.lang.Object
  extended by nathan.middleware.Message
All Implemented Interfaces:
java.io.Serializable

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

The messages to be sent in between the client and the server. Messages objects are sent between the cleint and server to commincate the method that should be invoked on an object and to return the value of the invocation to the client.

Author:
Nathan Balon
Advance Operating Systems CIS 578
University of Michigan Dearborn
Remote Method Invocation Middleware Project
See Also:
Serialized Form

Constructor Summary
Message()
          Creates a new instance of Message
Message(int messageType)
          Creates a new instance of Message.
Message(int aMessageType, int aRequestID, RemoteObjectReference aRor, java.lang.String aMethodName, java.util.Vector aArguments)
          Creates a new instance of Message to be passed
 
Method Summary
 boolean compareArgs(java.util.Vector otherArgs)
          Compare if to sets of arguments are equal.
 java.util.Vector getArguments()
          Get the arguments for the remote method invocation
 int getMessageID()
          Get the message ID of the message.
 int getMessageType()
          Get the type of message.
 java.lang.String getMethodName()
          Get the name of the method to be called.
 RemoteObjectReference getRemoteObjectReference()
          Get the remote object reference.
 void setArguments(java.util.Vector aArgs)
          Set the arguments to be passed to the remote method.
 void setMessageID(int messageID)
          Sets the Message ID
 void setMessageType(int aMessageType)
          Set the message type.
 void setMethodName(java.lang.String aMethodName)
          Set the method name to be called remotely.
 void setRemoteObjectReference(RemoteObjectReference aRor)
          Set the RemoteObjectReference.
 java.lang.String toString()
          Returns a string representation of the message sent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Message

public Message()
Creates a new instance of Message


Message

public Message(int messageType)
Creates a new instance of Message.

Parameters:
messageType - The type of message to be sent.

Message

public Message(int aMessageType,
               int aRequestID,
               RemoteObjectReference aRor,
               java.lang.String aMethodName,
               java.util.Vector aArguments)
Creates a new instance of Message to be passed

Parameters:
aMessageType - the type of message to be sent
aRequestID -
aRor - the remote object reference
aMethodName - the name of the method to be called
aArguments - the arguments to be passed to the method
Method Detail

getMessageType

public int getMessageType()
Get the type of message.

Returns:
int The message type.

setMessageType

public void setMessageType(int aMessageType)
Set the message type.

Parameters:
aMessageType - The type of message to be sent.

getMessageID

public int getMessageID()
Get the message ID of the message.

Returns:
int The message ID.

setMessageID

public void setMessageID(int messageID)
Sets the Message ID

Parameters:
messageID -

getRemoteObjectReference

public RemoteObjectReference getRemoteObjectReference()
Get the remote object reference.

Returns:
RemoteObjectReference The remote object reference held in the message.

setRemoteObjectReference

public void setRemoteObjectReference(RemoteObjectReference aRor)
Set the RemoteObjectReference.

Parameters:
aRor - The RemoteObjectReference

getMethodName

public java.lang.String getMethodName()
Get the name of the method to be called.

Returns:
String The method name

setMethodName

public void setMethodName(java.lang.String aMethodName)
Set the method name to be called remotely.

Parameters:
aMethodName - The method name to be called.

getArguments

public java.util.Vector getArguments()
Get the arguments for the remote method invocation

Returns:
Vector A vector holding a the aguments of a method.

setArguments

public void setArguments(java.util.Vector aArgs)
Set the arguments to be passed to the remote method.

Parameters:
aArgs - A vector of arguments to be passed to the remote method.

compareArgs

public boolean compareArgs(java.util.Vector otherArgs)
Compare if to sets of arguments are equal.

Parameters:
otherArgs - A vector of arguments to be compared.
Returns:
boolen true if the arguments are equal.

toString

public java.lang.String toString()
Returns a string representation of the message sent

Overrides:
toString in class java.lang.Object
Returns:
String the message string
See Also:
Object.toString()