com.ibm.tspaces.examples.simple
Class Simple2
java.lang.Object
|
+--com.ibm.tspaces.examples.simple.Simple2
- public class Simple2
- extends java.lang.Object
- implements Callback
|
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. |
void |
init(java.lang.String host)
|
static void |
main(java.lang.String[] argv)
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Simple2
public Simple2()
init
public void init(java.lang.String host)
call
public boolean call(java.lang.String eventName_,
java.lang.String tsName_,
int sequenceNumber_,
SuperTuple tuple_,
boolean isException_)
- Description copied from interface: Callback
- 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
- Specified by:
- call in interface Callback
- Tags copied from interface: Callback
- 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
main
public static void main(java.lang.String[] argv)