A independant pile for communication
Dear all,
I'm trying to have a main class that has an Automaton. This one works
and studies a problem: that may take a very long time. This automaton
has a Communicator with Javascript reduced to a minimum. In short:
----------------------------------------------------
public class Communicator{
JSObject derivedInnerHTML;
public Communicator (JSObject win){
this.derivedInnerHTML = (JSObject)
win.eval("document.getElementById('derived')");
}
public void CommDerived(String quoi){
derivedInnerHTML.setMember("innerHTML", quoi);
}
public void CommPlusDerived(String quoi){
derivedInnerHTML.setMember("innerHTML",
derivedInnerHTML.getMember("innerHTML") + quoi);
}
}
-----------------------------------------------------------------
And many other things of the same flavor.
I would like this communicator to be on another Thread that would
behave like a pile ... In the automaton I would write sleep(100)
regularly, and that would do the trick.
All my trials amounted finally to nothing :(
I could create a pile of message, create a Thread and have this pile
being read and displayed in run() with a wait() if the pile is empty and
a notifyAll() when the pile is fed.
I'm just wondering whether there is a simpler or more usual way to
address this issue.
Many thanks in advance!
Amities,
Olivier