package org.avis.client.examples;
import java.io.InputStreamReader;
import org.avis.client.Elvin;
import org.avis.client.Notification;
public class WallBroadcaster
{
public static void main (String [] args)
throws Exception
{
Elvin elvin =
new Elvin (System.getProperty ("elvin", "elvin://localhost"));
elvin.closeOnExit ();
System.out.println ("Type some lines of text to be broadcast over Elvin.");
System.out.println ("Hit Ctrl+C to exit.");
InputStreamReader in = new InputStreamReader (System.in);
int ch;
while ((ch = in.read ()) != -1)
{
Notification notification = new Notification ();
notification.set ("From", "wall");
notification.set ("Typed-Character", ch);
elvin.send (notification);
}
elvin.close ();
}
}