org.objectweb.proactive.core.event
Class MessageEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--org.objectweb.proactive.core.event.ProActiveEvent
              |
              +--org.objectweb.proactive.core.event.MessageEvent
All Implemented Interfaces:
Message, java.io.Serializable

public class MessageEvent
extends ProActiveEvent
implements Message, java.io.Serializable

A MessageEvent occurs when a Message get sent or received or when the treatment of a request begins or ends.

Since:
ProActive 0.9
Version:
1.0, 2001/10/23
Author:
ProActive Team
See Also:
Message, Serialized Form

Field Summary
protected  UniqueID destinationID
           
static int REPLY_RECEIVED
          constant indicating the encapsulated message has been received
static int REPLY_SENT
          constant indicating the encapsulated message has been sent
static int REQUEST_RECEIVED
          constant indicating the encapsulated message has been received
static int REQUEST_SENT
          constant indicating the encapsulated message has been sent
protected  int requestQueueLength
          Length of the request queue of the body that sends this event or -1 if this message did not affect the request queue length.
static int SERVING_STARTED
          constant indicating that the serving of the encapsulated request has started
static int VOID_REQUEST_SERVED
          constant indicating the encapsulated request without reply has been served
 
Fields inherited from class org.objectweb.proactive.core.event.ProActiveEvent
GENERIC_TYPE, timeStamp, type
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
MessageEvent(Message message, int messageActionType, UniqueID destinationID, int requestQueueLength)
          Creates a new MessageEvent based on the message message and on the given action
 
Method Summary
 UniqueID getDestinationBodyID()
          Returns the id of the body receiver of the encapsulated message.
 java.lang.String getMethodName()
          Returns the method name of the method call packed in this message
 int getRequestQueueLength()
          Returns the length of the request queue of the sending body or -1.
 long getSequenceNumber()
          Returns a unique sequence number of this message
 UniqueID getSourceBodyID()
          Returns the id of the body source of this message
 boolean isOneWay()
          Returns true if the message will not generate a response message
 java.lang.String toString()
          Returns a string representation of this event
 boolean wasSent()
           
 
Methods inherited from class org.objectweb.proactive.core.event.ProActiveEvent
getTimeStamp, getType
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.proactive.core.body.message.Message
getTimeStamp
 

Field Detail

REQUEST_SENT

public static final int REQUEST_SENT
constant indicating the encapsulated message has been sent

See Also:
Constant Field Values

REQUEST_RECEIVED

public static final int REQUEST_RECEIVED
constant indicating the encapsulated message has been received

See Also:
Constant Field Values

REPLY_SENT

public static final int REPLY_SENT
constant indicating the encapsulated message has been sent

See Also:
Constant Field Values

REPLY_RECEIVED

public static final int REPLY_RECEIVED
constant indicating the encapsulated message has been received

See Also:
Constant Field Values

VOID_REQUEST_SERVED

public static final int VOID_REQUEST_SERVED
constant indicating the encapsulated request without reply has been served

See Also:
Constant Field Values

SERVING_STARTED

public static final int SERVING_STARTED
constant indicating that the serving of the encapsulated request has started

See Also:
Constant Field Values

destinationID

protected UniqueID destinationID

requestQueueLength

protected int requestQueueLength
Length of the request queue of the body that sends this event or -1 if this message did not affect the request queue length.

Constructor Detail

MessageEvent

public MessageEvent(Message message,
                    int messageActionType,
                    UniqueID destinationID,
                    int requestQueueLength)
Creates a new MessageEvent based on the message message and on the given action

Method Detail

getDestinationBodyID

public UniqueID getDestinationBodyID()
Returns the id of the body receiver of the encapsulated message. For a VOID_REQUEST_SERVED message, this is the destination body of the encapsulated request, i.e. the body that sends this event!

Returns:
the id of the body receiver of the encapsulated message

getRequestQueueLength

public int getRequestQueueLength()
Returns the length of the request queue of the sending body or -1.

Returns:
the length of the request queue of the sending body or -1.

toString

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

Overrides:
toString in class ProActiveEvent
Returns:
a string representation of this event

wasSent

public boolean wasSent()

getSourceBodyID

public UniqueID getSourceBodyID()
Description copied from interface: Message
Returns the id of the body source of this message

Specified by:
getSourceBodyID in interface Message
Returns:
the id of the body source of this message

getMethodName

public java.lang.String getMethodName()
Description copied from interface: Message
Returns the method name of the method call packed in this message

Specified by:
getMethodName in interface Message
Returns:
the method name of the method call packed in this message

getSequenceNumber

public long getSequenceNumber()
Description copied from interface: Message
Returns a unique sequence number of this message

Specified by:
getSequenceNumber in interface Message
Returns:
a unique sequence number of this message

isOneWay

public boolean isOneWay()
Description copied from interface: Message
Returns true if the message will not generate a response message

Specified by:
isOneWay in interface Message
Returns:
true if the message will not generate a response message


Copyright © April 2004 INRIA All Rights Reserved.