Methods Summary |
---|
public synchronized java.lang.String | getMessage()
notify( );
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( ) );
notify( );
|
public void | run()
try {
while ( true ) {
putMessage( );
sleep( 1000 );
}
}
catch( InterruptedException e ) { }
|