com.ibm.tspaces
Interface Callback
- All Known Implementing Classes:
- Waiter, WhiteboardPanel, TClipboard, AppletTst1, Example3, Simple2, TService, SendMail, PrintText, TstServer, Pager
- 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 Summary |
boolean |
call(java.lang.String eventName_,
java.lang.String tsName_,
int sequenceNumber_,
SuperTuple tuple_,
boolean isException_)
Call an application back with a tuple it requested. |
call
public boolean call(java.lang.String eventName_,
java.lang.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 (Peter)
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/commandtuple_ - the returned tuple or a Tuple with an exception insideisException_ - 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