|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrice.tutorial.splitstream.MySplitStreamClient
public class MySplitStreamClient
We implement the Application interface to receive regular timed messages (see lesson5). We implement the ScribeClient interface to receive scribe messages (called ScribeContent).
Field Summary | |
---|---|
static int |
DATA_LENGTH
The lenght of a message in bytes. |
protected Endpoint |
endpoint
The Endpoint represents the underlieing node. |
static int |
NUM_PUBLISHES
The number of messages to publish. |
protected RandomSource |
random
Data source... |
Constructor Summary | |
---|---|
MySplitStreamClient(Node node)
The constructor for this scribe client. |
Method Summary | |
---|---|
void |
deliver(Id id,
Message message)
Part of the Application interface. |
void |
deliver(Stripe s,
byte[] data)
Called whenever we receive a published message. |
boolean |
forward(RouteMessage message)
DESCRIBE THE METHOD |
void |
joinFailed(Stripe s)
DESCRIBE THE METHOD |
void |
publish()
Multicasts data. |
void |
startPublishTask()
Starts the publish task. |
void |
subscribe()
Subscribes to all stripes in myChannelId. |
void |
update(NodeHandle handle,
boolean joined)
DESCRIBE THE METHOD |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected RandomSource random
protected Endpoint endpoint
public static final int DATA_LENGTH
public static final int NUM_PUBLISHES
Constructor Detail |
---|
public MySplitStreamClient(Node node)
node
- the PastryNodeMethod Detail |
---|
public void subscribe()
public void startPublishTask()
public void deliver(Id id, Message message)
deliver
in interface Application
id
- DESCRIBE THE PARAMETERmessage
- DESCRIBE THE PARAMETERpublic void publish()
public void deliver(Stripe s, byte[] data)
deliver
in interface SplitStreamClient
s
- DESCRIBE THE PARAMETERdata
- DESCRIBE THE PARAMETERpublic void joinFailed(Stripe s)
joinFailed
in interface SplitStreamClient
s
- DESCRIBE THE PARAMETERpublic boolean forward(RouteMessage message)
forward
in interface Application
message
- DESCRIBE THE PARAMETER
public void update(NodeHandle handle, boolean joined)
update
in interface Application
handle
- DESCRIBE THE PARAMETERjoined
- DESCRIBE THE PARAMETER
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |