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.pastry.standard
Class StandardJoinProtocol

    java.lang.Object
      rice.pastry.client.PastryAppl
          rice.pastry.standard.StandardJoinProtocol

All Implemented Interfaces:
  JoinProtocol

Direct Known Subclasses:
  ConsistentJoinProtocol

    public class StandardJoinProtocol

extends PastryAppl
implements JoinProtocol

An implementation of a simple join protocol.

Version:
  $Id: StandardJoinProtocol.java 3966 2007-11-15 22:11:14Z jeffh $
Author:
  Peter Druschel, Andrew Ladd, Rongmei Zhang, Y. Charlie Hu

Field Summary
`protected ScheduledMessage` | `joinEvent`
`protected LeafSet` | `leafSet`
`protected NodeHandle` | `localHandle`
`protected RoutingTable` | `routeTable`

Fields inherited from class rice.pastry.client.PastryAppl
`address, deserializer, instance, logger, options, receiver, thePastryNode`

Constructor Summary
`StandardJoinProtocol(PastryNode ln, NodeHandle lh, RoutingTable rt, LeafSet ls)` Constructor.
`StandardJoinProtocol(PastryNode ln, NodeHandle lh, RoutingTable rt, LeafSet ls, MessageDeserializer md)`

Method Summary
`void` | `broadcastRows(JoinRequest jr)` Broadcasts the route table rows.
`boolean` | `deliverWhenNotReady()` We always want to receive messages.
`int` | `getAddress()` Get address.
`void` | `initiateJoin(java.util.Collection<NodeHandle> bootstrap)`
`void` | `messageForAppl(Message msg)` Should not be called becasue we are overriding the receiveMessage() interface anyway.
`void` | `receiveMessage(Message msg)` Receives a message from the outside world.
`protected void` | `setReady()` Can be overloaded to do additional things before going ready.

Methods inherited from class rice.pastry.client.PastryAppl
`accept, canReceiveSocket, connect, destroy, enrouteMessage, finishReceiveSocket, getDeserializer, getLeafSet, getNodeHandle, getNodeId, getRoutingTable, isClosest, leafSetChange, notifyReady, receiveMessageInternal, register, routeMsg, routeMsg, routeMsgDirect, routeSetChange, setDeserializer`

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

Field Detail

### localHandle

    protected NodeHandle localHandle

### routeTable

    protected RoutingTable routeTable

### leafSet

    protected LeafSet leafSet

### joinEvent

    protected ScheduledMessage joinEvent

Constructor Detail

### StandardJoinProtocol

    public StandardJoinProtocol(PastryNode ln,
                                NodeHandle lh,
                                RoutingTable rt,
                                LeafSet ls)

  Constructor.

  Parameters:
    `lh` - the local node handle.
    `sm` - the Pastry security manager.

### StandardJoinProtocol

    public StandardJoinProtocol(PastryNode ln,
                                NodeHandle lh,
                                RoutingTable rt,
                                LeafSet ls,
                                MessageDeserializer md)

Method Detail

### getAddress

    public int getAddress()

  Get address.

  Overrides:
    `getAddress` in class `PastryAppl`
  Returns:
    gets the address.

### initiateJoin

    public void initiateJoin(java.util.Collection<NodeHandle> bootstrap)

  Specified by:
    `initiateJoin` in interface `JoinProtocol`

### receiveMessage

    public void receiveMessage(Message msg)

  Receives a message from the outside world.

  Overrides:
    `receiveMessage` in class `PastryAppl`
  Parameters:
    `msg` - the message that was received.

### setReady

    protected void setReady()

  Can be overloaded to do additional things before going ready. For example, verifying that other nodes are aware of us, so that consistent routing is guaranteed.

### broadcastRows

    public void broadcastRows(JoinRequest jr)

  Broadcasts the route table rows.

  Parameters:
    `jr` - the join row.

### messageForAppl

    public void messageForAppl(Message msg)

  Should not be called becasue we are overriding the receiveMessage() interface anyway.

  Specified by:
    `messageForAppl` in class `PastryAppl`
  Parameters:
    `msg` - the message that is arriving.

### deliverWhenNotReady

    public boolean deliverWhenNotReady()

  We always want to receive messages.

  Overrides:
    `deliverWhenNotReady` in class `PastryAppl`
  Returns:
    false unless the node is a service

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.