All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.ibm.tspaces.Callback

public interface Callback
The Callback interface is implemented by the class that is given to the tuple space call back mechanism for notification that some tuple became "available" on the server

Author:
Pete Wyckoff
See Also:
TupleSpace, CallbackThread, TSDispatch

Method Index

 o call(String, String, int, SuperTuple, boolean)
call an application back with a tuple it requested.

Methods

 o call
 public abstract boolean call(String eventName_,
                              String tsName_,
                              int sequenceNumber_,
                              SuperTuple tuple_,
                              boolean isException_)
call an application back with a tuple it requested. In the case of an exceptional condition occurring on the server, isException will be true and the exception will be inside the tuple_, i.e., the tuple will contain one field that is a TupleSpaceServerException. This method is called by the callback thread and thus should do something really quick and return, that is it should not take up lots of time. Typically, it might just queue up the tuple and isException and wake up some other thread that will do the real processing, at least that is the intention. This design may need to be changed in which case one alternative is for this guy to be a thread which gets fired up by the callback thread. I am not sure as to whether JavaSpaces makes this into a new thread or not even after looking at the section on it, but I will come back to this. PW Also, true is returned if this is the last call this callback class is expecting. For a one time read or in etc this is the case, but for EventHandlers, this is not the case, they will keep on servicing more and more events. The problem here may be that I am using one interface for two somewhat different things, although they are only really different in their longevity. Let's keep it this way until we see how the API should evolve. PW

Parameters:
eventName_ - the name of the event command that caused this call, that is the name of the client side command of the thread that registered this call, e.g., in the case of a read, this would be TupleSpace.READ, **not** TupleSpace.WRITE which is the corresponding command that caused the actaul event.
tsName_ - the name of the tuple space this command was executed on.
sequenceNumber_ - the sequenceNumber for this event/command
tuple_ - the returned tuple or a Tuple with an exception inside
isException_ - was the command processed normaly or was there an exception
Returns:
true if this is the last call this sequence # should be getting otherwise false
See Also:
TupleSpace, CallbackThread, TSDispatch

All Packages  Class Hierarchy  This Package  Previous  Next  Index