package org.avis.client.examples;
import org.avis.client.Elvin;
import org.avis.client.GeneralNotificationEvent;
import org.avis.client.GeneralNotificationListener;
public class WallReceiver
{
public static void main (String [] args)
throws Exception
{
Elvin elvin =
new Elvin (System.getProperty ("elvin", "elvin://localhost"));
elvin.closeOnExit ();
elvin.subscribe ("From == 'wall' && int32 (Typed-Character)");
elvin.addNotificationListener (new GeneralNotificationListener ()
{
public void notificationReceived (GeneralNotificationEvent e)
{
System.out.print ((char)e.notification.getInt ("Typed-Character"));
}
});
System.out.println ("Listening for Wall messages...");
System.out.println ("Hit Ctrl+C to exit.");
}
}