|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PeerInterface
This interface is implemented by classes that handle incoming and outgoing message traffic for the peer. The interface has some factory methods that allow implementers to decide how to create and allocate objects. TODO: manage threads from this object
| Method Summary | |
|---|---|
void |
broadcast(java.lang.Object msg)
Broadcast a message to all members of this peer's group. |
boolean |
configure(java.util.Map<java.lang.String,java.lang.Object> configuration)
Because implementors can be of any type, the configuration is an Object, no constraints to impose here as there is no common set of configuration properties. |
PeerNetwork |
getPeerNetwork()
|
HyperGraphPeer |
getThisPeer()
Return the HyperGraphPeer to which this PeerInterface
is bound. |
PeerFilter |
newFilterActivity(PeerFilterEvaluator evaluator)
|
PeerRelatedActivityFactory |
newSendActivityFactory()
|
void |
run(java.util.concurrent.ExecutorService executorService)
Execute the message handling loop of this interface. |
java.util.concurrent.Future<java.lang.Boolean> |
send(java.lang.Object networkTarget,
java.lang.Object msg)
|
void |
setMessageHandler(MessageHandler message)
There is only one MessageHandler for incoming message through
a given PeerInterface and this method sets it for this one. |
void |
setThisPeer(HyperGraphPeer thisPeer)
Internally used to initialize the PeerInterface, don't call in application code. |
void |
stop()
Stop the PeerInterface - no more messages are going to be
received or sent. |
| Method Detail |
|---|
void setMessageHandler(MessageHandler message)
There is only one MessageHandler for incoming message through
a given PeerInterface and this method sets it for this one.
message - boolean configure(java.util.Map<java.lang.String,java.lang.Object> configuration)
configuration -
void run(java.util.concurrent.ExecutorService executorService)
Execute the message handling loop of this interface. This method is akin to a vanilla
run, but with the additional constraint that a specific
ExecutorService must be used for the main message handling thread as
well as for all activities triggered by this PeerInterface.
executorService - void stop()
Stop the PeerInterface - no more messages are going to be
received or sent.
HyperGraphPeer getThisPeer()
Return the HyperGraphPeer to which this PeerInterface
is bound.
void setThisPeer(HyperGraphPeer thisPeer)
Internally used to initialize the PeerInterface, don't call in application code.
PeerNetwork getPeerNetwork()
PeerFilter newFilterActivity(PeerFilterEvaluator evaluator)
PeerRelatedActivityFactory newSendActivityFactory()
void broadcast(java.lang.Object msg)
Broadcast a message to all members of this peer's group.
msg -
java.util.concurrent.Future<java.lang.Boolean> send(java.lang.Object networkTarget,
java.lang.Object msg)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||