org.kth.dks.dks_dht
Interface DKSDHTCallback

All Known Implementing Classes:
DKSMCastDHTImpl, PlanetLabDKS, StrechMeter

public interface DKSDHTCallback

Callbacks from messages received by the DHT but belonging to a higher layer are handled by instances of this interface


Method Summary
 void dhtBroadcastCallback(DKSObject value)
          Receive a broadcast message
 DKSMessage dhtRouteCallback(long identifier, DKSMessage value)
          The callback is called at the responsible node when a route() message reaches its destination and the message is not handled at a lower abstraction layer.
 void dhtRouteCallbackAsync(long identifier, DKSMessage payload)
          The callback is called at the responsible node when a route() message reaches its destination and the message is not handled at a lower abstraction layer.
 

Method Detail

dhtBroadcastCallback

void dhtBroadcastCallback(DKSObject value)
Receive a broadcast message


dhtRouteCallback

DKSMessage dhtRouteCallback(long identifier,
                            DKSMessage value)
The callback is called at the responsible node when a route() message reaches its destination and the message is not handled at a lower abstraction layer. It receives a DKSMessage, and returns a possibly new DKSMessage 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 or null if the message is unhandled

dhtRouteCallbackAsync

void dhtRouteCallbackAsync(long identifier,
                           DKSMessage payload)
The callback is called at the responsible node when a route() message reaches its destination and the message is not handled at a lower abstraction layer. It receives a DKSMessage

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


Copyright © 2010. All Rights Reserved.