|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kth.dks.DKSImpl
public class DKSImpl
| Field Summary | |
|---|---|
protected ConnectionManager |
cm
|
protected DKSNode |
myDKSNode
|
protected DKSRef |
myDKSRef
|
| Constructor Summary | |
|---|---|
DKSImpl(ConnectionManager _cm,
DKSOverlayAddress over)
|
|
DKSImpl(ConnectionManager _cm,
long nodeId,
long gId,
long GUID)
|
|
DKSImpl(ConnectionManager _cm,
long nodeId,
java.net.URL nodeAddress)
|
|
| Method Summary | |
|---|---|
boolean |
addMsgHandler(DKSMessage msg,
java.lang.Object handlerObject,
java.lang.String methodName)
Registers a handler for a DKSMessage. |
long |
addressSpace()
|
void |
broadcast(DKSObject message)
Broadcasts the given message. |
void |
broadcastRestricted(DKSObject message,
long startId,
long endId)
Broadcasts to nodes with identifiers within the rand startId and endId [] |
void |
create()
first node should call this |
DKSRef |
findResponsible(long identifier)
Finds the responsible node for a certain identifier |
ConnectionManager |
getCM()
|
CommunicationInfo |
getComInfo()
|
java.io.Serializable |
getDebugInfo()
|
DKSMarshal |
getDKSMarshal()
|
DKSRef |
getDKSRef()
Returns the DKSRef associated to this DKS node |
java.lang.String |
getDKSURL()
Returns the DKSURL (stringified DKSRef) used by this DKS node |
MessageInfo[] |
getMessageInfo()
|
DKSNode |
getMyDKSNode()
|
NodeInfo |
getNodeInfo()
|
void |
join(DKSRef existingnodeAddress)
Adds a new node to the network managed by the local DKS implementation. |
void |
join(long existingnodeId,
java.net.URL existingnodeAddress)
|
void |
joinCallbackReturn()
INVARIANT: should be called by DKSAppInterface every time DKSAppInterface.joinCallback() is called |
void |
leave()
Disconnect the local node from the network. |
void |
leaveCallbackReturn()
INVARIANT: should be called by DKSAppInterface every time DKSAppInterface.leaveCallback() is called |
void |
logLevel(int level)
Set the logging level |
DKSObject |
route(long identifier,
DKSObject payload)
Will route a message the DKS node that is responsible for the given identifier and give it the payload, upon which the responsible node will respond with a payload which is returned |
void |
routeAsync(long identifier,
DKSObject payload)
Will route a message to the DKS node that is responsible for the given identifier and give it the payload, upon which the responsible node will respond with a payload which is returned |
void |
routeAsyncFrom(long identifier,
DKSObject payload,
DKSRef firstNode)
Will route a message from firstNode to the DKS node that is responsible for the given identifier and give it the payload, upon which the responsible node will respond with a payload which is returned |
void |
send(DKSRef target,
DKSMessage message)
Send the message to the specified recipient node. |
DKSCallbackInterface |
setCallbackHandler(DKSAppInterface appHandler)
Instructs the DKS system to pass on all received messages to the specified DKSMessageReceiver. |
void |
unregisterNode()
Every object implementing this interface gets registered in a ConnectionManager, this method this method unregisters the object in the ConnectionManager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DKSNode myDKSNode
protected ConnectionManager cm
protected DKSRef myDKSRef
| Constructor Detail |
|---|
public DKSImpl(ConnectionManager _cm,
long nodeId,
java.net.URL nodeAddress)
throws DKSNodeAlreadyRegistered
DKSNodeAlreadyRegistered
public DKSImpl(ConnectionManager _cm,
DKSOverlayAddress over)
throws DKSNodeAlreadyRegistered
DKSNodeAlreadyRegistered
public DKSImpl(ConnectionManager _cm,
long nodeId,
long gId,
long GUID)
throws DKSNodeAlreadyRegistered
DKSNodeAlreadyRegistered| Method Detail |
|---|
public java.lang.String getDKSURL()
DKSInterface
getDKSURL in interface DKSInterfaceDKSRef
public void join(long existingnodeId,
java.net.URL existingnodeAddress)
throws DKSTooManyRestartJoins,
DKSIdentifierAlreadyTaken
DKSTooManyRestartJoins
DKSIdentifierAlreadyTakenpublic void create()
create in interface DKSInterface
public void join(DKSRef existingnodeAddress)
throws DKSTooManyRestartJoins,
DKSIdentifierAlreadyTaken,
DKSRefNoResponse
DKSInterface
join in interface DKSInterfaceDKSTooManyRestartJoins
DKSIdentifierAlreadyTaken
DKSRefNoResponsepublic void logLevel(int level)
DKSInterface
logLevel in interface DKSInterfacelevel - int, 0 means no logging, 1 means debug prints, 2 means XML dumpspublic void leave()
leave in interface DKSInterfacepublic DKSRef findResponsible(long identifier)
findResponsible in interface DKSInterfaceidentifier - long describing the target identifier whose responsible is to be found
public DKSObject route(long identifier,
DKSObject payload)
route in interface DKSInterfaceidentifier - whose responsible node being routed topayload - to be sent to the responsible node
DKSAppInterface
public void routeAsync(long identifier,
DKSObject payload)
routeAsync in interface DKSInterfaceidentifier - whose responsible node being routed topayload - to be sent to the responsible nodeDKSAppInterface
public void routeAsyncFrom(long identifier,
DKSObject payload,
DKSRef firstNode)
routeAsyncFrom in interface DKSInterfaceidentifier - longpayload - DKSObjectfirstNode - DKSRef
public void send(DKSRef target,
DKSMessage message)
send in interface DKSInterfacetarget - a DKSRef to a node in the systemmessage - a DKSMessagepublic void broadcast(DKSObject message)
broadcast in interface DKSInterface
public void broadcastRestricted(DKSObject message,
long startId,
long endId)
broadcastRestricted in interface DKSInterfacemessage - DKSObject message to be sentstartId - long beginning of the intervalendId - long end of the intervalpublic DKSCallbackInterface setCallbackHandler(DKSAppInterface appHandler)
setCallbackHandler in interface DKSCallbackInterfaceappHandler - DKSAppInterface interface to the application for callbacks
DKSCallBackInterface, DKSAppInterfacepublic NodeInfo getNodeInfo()
public java.io.Serializable getDebugInfo()
public CommunicationInfo getComInfo()
public MessageInfo[] getMessageInfo()
public DKSMarshal getDKSMarshal()
public long addressSpace()
public DKSNode getMyDKSNode()
public void unregisterNode()
DKSInterface
unregisterNode in interface DKSInterfacepublic void joinCallbackReturn()
DKSCallbackInterface
joinCallbackReturn in interface DKSCallbackInterfaceDKSAppInterfacepublic void leaveCallbackReturn()
leaveCallbackReturn in interface DKSCallbackInterfaceDKSAppInterfacepublic ConnectionManager getCM()
public boolean addMsgHandler(DKSMessage msg,
java.lang.Object handlerObject,
java.lang.String methodName)
DKSInterface
addMsgHandler in interface DKSInterfacemsg - Some object which is a subclass of DKSMessagehandlerObject - Object whose method will be invoked upon receipt of a message of type DKSMessagemethodName - full case sensitive of the method to be invoked(without paranthesis). The method has a predefined signature
as described in the following example.
Example: if the method name is "handleStore", there should a method in handlerObject with the signature
public void handleStore(DKSRef sender, msgClass msg)msg.
DKSInterface.addMsgHandler()public DKSRef getDKSRef()
DKSInterface
getDKSRef in interface DKSInterfaceDKSRef
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||