fr.dgac.ivy
Interface IvyApplicationListener

All Superinterfaces:
java.util.EventListener
All Known Implementing Classes:
IvyApplicationAdapter, Probe

public interface IvyApplicationListener
extends java.util.EventListener

this interface specifies the methods of an ApplicationListener


Method Summary
 void connect(fr.dgac.ivy.IvyClient client)
          invoked when a Ivy Client has joined the bus
 void die(fr.dgac.ivy.IvyClient client, int id, java.lang.String msgarg)
          invoked when a peer request us to leave the bus
 void directMessage(fr.dgac.ivy.IvyClient client, int id, java.lang.String msgarg)
          invoked when a peer sends us a direct message
 void disconnect(fr.dgac.ivy.IvyClient client)
          invoked when a Ivy Client has left the bus
 

Method Detail

connect

public void connect(fr.dgac.ivy.IvyClient client)
invoked when a Ivy Client has joined the bus

Parameters:
client - the peer

disconnect

public void disconnect(fr.dgac.ivy.IvyClient client)
invoked when a Ivy Client has left the bus

Parameters:
client - the peer

die

public void die(fr.dgac.ivy.IvyClient client,
                int id,
                java.lang.String msgarg)
invoked when a peer request us to leave the bus

Parameters:
client - the peer

directMessage

public void directMessage(fr.dgac.ivy.IvyClient client,
                          int id,
                          java.lang.String msgarg)
invoked when a peer sends us a direct message

Parameters:
client - the peer
id -
msgarg - the message itself there is no need to use a bus close() or stop() operation within a die() method, it will be called automatically. Furthermore, it is considered poor style to enforce the end of a program with System.exit(), you should consider terminating all threads ( AWT, etc )