jgroup.core
Interface Callback


public interface Callback

When performing an asynchronous internal group method invocation (IGMI), an invoker may specify a callback object. The task of this callback object is to collect regular values and exceptions returned by members executing the asynchronous IGMI.

For each of the members contained in the view in which the invocation is executed, methods result or exception are invoked on the callback object. If a member becomes unreachable before being able to return a value or an exception to the invoker, then the callback object is notified through the invocation of method exception with a RemoteException as argument. Otherwise, the regular value or the exception is communicated to the callback object through the invocation of methods result or exception.

In both these methods, the identifier of the member returning the value or the exception is provided. On the other hand, no invocation identifier is provided. If the invoker need to distinguish return values associated to distinct exceptions, distinct callback objects should be used.

Since:
Jgroup 0.8
Author:
Alberto Montresor

Method Summary
 void exception(MemberId id, java.lang.Exception e)
          Invoked by internal GMI service to notify this callback object that the member identified by MemberId has thrown e.
 void result(MemberId id, java.lang.Object result)
          Invoked by internal GMI service to notify this callback object that the member identified by MemberId has returned result.
 

Method Detail

result

void result(MemberId id,
            java.lang.Object result)
Invoked by internal GMI service to notify this callback object that the member identified by MemberId has returned result.

Parameters:
id - the member identifier
result - the regular value returned by the asynchronous invocation

exception

void exception(MemberId id,
               java.lang.Exception e)
Invoked by internal GMI service to notify this callback object that the member identified by MemberId has thrown e.

Parameters:
id - the member identifier
e - the exception thrown by the asynchronous invocation


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.