Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rice.p2p.past.messaging
Class PastMessage

    java.lang.Object
      rice.p2p.past.messaging.PastMessage

All Implemented Interfaces:
  Message, java.io.Serializable

Direct Known Subclasses:
  CacheMessage, ContinuationMessage, GCCollectMessage, MessageLostMessage

public abstract class PastMessage
extends java.lang.Object
implements Message

Version:
  $Id: PastMessage.java,v 1.7 2005/03/11 00:58:05 jeffh Exp $
Author:
  Alan Mislove, Ansley Post, Peter Druschel
See Also:
  Serialized Form

Field Summary
`protected Id` | `dest` DESCRIBE THE FIELD
`protected int` | `id` DESCRIBE THE FIELD
`protected boolean` | `isResponse` DESCRIBE THE FIELD
`protected NodeHandle` | `source` DESCRIBE THE FIELD

Fields inherited from interface rice.p2p.commonapi.Message
`HIGH_PRIORITY, LOW_PRIORITY, MEDIUM_HIGH_PRIORITY, MEDIUM_LOW_PRIORITY, MEDIUM_PRIORITY`

Constructor Summary
`protected` | `PastMessage(int id, NodeHandle source, Id dest)` Constructor which takes a unique integer Id

Method Summary
`void` | `addHop(NodeHandle handle)` Method which is designed to be overridden by subclasses if they need to keep track of where they've been.
`Id` | `getDestination()` Method which returns this messages' destination address
`int` | `getPriority()` Method which should return the priority level of this message.
`NodeHandle` | `getSource()` Method which returns this messages' source address
`int` | `getUID()` Method which returns this messages' unique id
`boolean` | `isResponse()` Method which returns whether or not this message is a response.
`abstract void` | `returnResponse(Continuation c)` Method by which this message is supposed to return it's response.
`protected void` | `setResponse()` Method which builds a response for this message, using the provided object as a result.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### id

    protected int id

  DESCRIBE THE FIELD

### source

    protected NodeHandle source

  DESCRIBE THE FIELD

### dest

    protected Id dest

  DESCRIBE THE FIELD

### isResponse

    protected boolean isResponse

  DESCRIBE THE FIELD

Constructor Detail

### PastMessage

    protected PastMessage(int id,
                          NodeHandle source,
                          Id dest)

  Constructor which takes a unique integer Id

Parameters:
  `id` - The unique id
  `source` - The source address
  `dest` - The destination address

Method Detail

### getPriority

    public int getPriority()

  Method which should return the priority level of this message. The messages can range in priority from 0 (highest priority) to Integer.MAX_VALUE (lowest) - when sending messages across the wire, the queue is sorted by message priority. If the queue reaches its limit, the lowest priority messages are discarded. Thus, applications which are very verbose should have LOW_PRIORITY or lower, and applications which are somewhat quiet are allowed to have MEDIUM_PRIORITY or possibly even HIGH_PRIORITY.

  Specified by:
    `getPriority` in interface `Message`
  Returns:
    This message's priority

### getUID

    public int getUID()

  Method which returns this messages' unique id

  Returns:
    The id of this message

### getSource

    public NodeHandle getSource()

  Method which returns this messages' source address

  Returns:
    The source of this message

### getDestination

    public Id getDestination()

  Method which returns this messages' destination address

  Returns:
    The dest of this message

### isResponse

    public boolean isResponse()

  Method which returns whether or not this message is a response.

  Returns:
    whether or not this message is a response.

### setResponse

    protected void setResponse()

  Method which builds a response for this message, using the provided object as a result. Should be overriden by subclasses, but with the super.setResponse() called.

### returnResponse

    public abstract void returnResponse(Continuation c)

  Method by which this message is supposed to return it's response.

  Parameters:
    `c` - The continuation to return the reponse to.

### addHop

    public void addHop(NodeHandle handle)

  Method which is designed to be overridden by subclasses if they need to keep track of where they've been.

  Parameters:
    `handle` - The current local handle

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.