org.kth.dks
Interface DKSAppInterface

All Known Implementing Classes:
DefaultAppHandler, DKSDHTImpl

public interface DKSAppInterface

Title: DKS

Description: DKS Middleware

Copyright: Copyright (c) 2004

Company: KTH-IMIT/SICS

Version:
1.0
Author:
not attributable

Method Summary
 void broadcastCallback(DKSObject payload)
          This callback routine is called when the node recieves a broadcast message.
 void failCallback(DKSRef failed, DKSRef failedPred)
          This callback routine is called at the successor of a filed node, when it detects its predecessor has failed.
 void joinCallback(DKSRef pred, DKSRef succ)
          This callback routine is called at the joining node, when the node is about to join INVARIANT: this method must make a callback to DKSCallbacks.joinCallbackReturn
 void leaveCallback(DKSRef pred, DKSRef succ)
          This callback routine is called at the leaving node, when the node is about to leave INVARIANT: this method must make a callback to DKSCallbacks.joinCallbackReturn
 DKSObject routeCallback(long identifier, DKSObject payload)
          Is set in DKSInterface through setCallbackHandler().
 void routeCallbackAsync(long identifier, DKSObject payload)
          Is set in DKSInterface through setCallbackHandler().
 

Method Detail

routeCallback

DKSObject routeCallback(long identifier,
                        DKSObject payload)
Is set in DKSInterface through setCallbackHandler(). It is called at the responsible node when a route() message reaches its destination. It receives a DKSObject, and returns a possibly new DKSObject INVARIANT: the implementor of this method SHOULD immediately return, as otherwise the underlying DKSNode cannot process new messagesl, and consequently the method cannot recursively call other methods in the DKSInterface as the DKSNode will not be able to receive response messages. Consider using routeAsync() in DKSInterface.

Parameters:
identifier - long, the identifier searched for in route, maybe not interesting for the app in many cases.
payload - DKSObject, the actual payload sent by the source
Returns:
DKSObject the payload to be routed back

routeCallbackAsync

void routeCallbackAsync(long identifier,
                        DKSObject payload)
Is set in DKSInterface through setCallbackHandler(). It is called at the responsible node when a route() message reaches its destination. as the DKSNode will not be able to receive response messages. Consider using routeAsync() in DKSInterface.

Parameters:
identifier - long, the identifier searched for in route, maybe not interesting for the app in many cases.
payload - DKSObject, the actual payload sent by the source

broadcastCallback

void broadcastCallback(DKSObject payload)
This callback routine is called when the node recieves a broadcast message. Note that the sender of a broadcast also recieves a broadcast msg.

Parameters:
payload - DKSObject, the actual payload sent by the source

joinCallback

void joinCallback(DKSRef pred,
                  DKSRef succ)
This callback routine is called at the joining node, when the node is about to join INVARIANT: this method must make a callback to DKSCallbacks.joinCallbackReturn

Parameters:
pred - DKSRef predecessor reference, containing the identifier of the predecessor (useful for DHT impl)
succ - DKSRef successor, containing the identifier of the successor (useful for DHT impl)

leaveCallback

void leaveCallback(DKSRef pred,
                   DKSRef succ)
This callback routine is called at the leaving node, when the node is about to leave INVARIANT: this method must make a callback to DKSCallbacks.joinCallbackReturn

Parameters:
pred - DKSRef predecessor reference, containing the identifier of the predecessor (useful for DHT impl)
succ - DKSRef successor, containing the identifier of the successor (useful for DHT impl)

failCallback

void failCallback(DKSRef failed,
                  DKSRef failedPred)
This callback routine is called at the successor of a filed node, when it detects its predecessor has failed.

Parameters:
failed - DKSRef to the failed node (useful for DHT impl)
failedPred - DKSRef to the failed nodes predecessor (useful for DHT impl)


Copyright © 2010. All Rights Reserved.