jegg.impl
Class MessageImpl

java.lang.Object
  extended byjegg.impl.MessageImpl
All Implemented Interfaces:
Message

public class MessageImpl
extends java.lang.Object
implements Message

Used to wrap an application message that is being sent from one egg to another.

The Message instance not wraps the sending egg's concrete message object, but also holds a reference to the sending egg's own message port and the priority of the message.

An egg can use a special base-class method, Egg.createMessage(), to wrap an application message before writing it to a message port.


Constructor Summary
MessageImpl(java.lang.Object m, Port p, Priority pr)
          Create a JEgg message.
 
Method Summary
 Port getFrom()
          Return the port of the egg that sent this message.
 java.lang.Object getMessage()
          Return the application message.
 Priority getPriority()
          Return the dispatch priority of this message.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageImpl

public MessageImpl(java.lang.Object m,
                   Port p,
                   Priority pr)
Create a JEgg message.

Parameters:
m - the application message being sent.
p - the port of the sending egg.
pr - the message's dispatch priority.
Method Detail

getFrom

public final Port getFrom()
Description copied from interface: Message
Return the port of the egg that sent this message.

Specified by:
getFrom in interface Message
Returns:
the sending egg's message port.

getMessage

public final java.lang.Object getMessage()
Description copied from interface: Message
Return the application message.

Specified by:
getMessage in interface Message
Returns:
the application message wrapped by this JEgg message.

getPriority

public final Priority getPriority()
Description copied from interface: Message
Return the dispatch priority of this message.

Specified by:
getPriority in interface Message
Returns:
dispatch priority.

toString

public final java.lang.String toString()


Copyright © 2004 . All Rights Reserved.