Methods Summary |
---|
public synchronized java.lang.String | getMessage()
notifyAll();
while ( messages.size() == 0 )
wait();
String message = (String)messages.firstElement();
messages.removeElement( message );
return message;
|
private synchronized void | putMessage()
while ( messages.size() == MAXQUEUE )
wait();
messages.addElement( new java.util.Date().toString() );
notifyAll();
|
public void | run()
try {
while ( true ) {
putMessage();
sleep( 1000 );
}
} catch( InterruptedException e ) { }
|