fr.dgac.ivy

Class IvyApplicationAdapter

Known Direct Subclasses:

WaiterClient
public abstract class IvyApplicationAdapter
extends java.lang.Object
implements IvyApplicationListener

this class is a dummy ApplicationListener

Method Summary

public void connect(IvyClient client)
invoked when a Ivy Client has joined the bus
public void die(IvyClient client, int id, String msgarg)
invoked when a peer request us to leave the bus
public void directMessage(IvyClient client, int id, String msgarg)
invoked when a peer sends us a direct message
public void disconnect(IvyClient client)
invoked when a Ivy Client has left the bus

Method Details

connect

public void connect(IvyClient client)

invoked when a Ivy Client has joined the bus

Specified by:

connect in interface IvyApplicationListener

Parameters:

client - the peer

die

public void die(IvyClient client, int id, String msgarg)

invoked when a peer request us to leave the bus

Specified by:

die in interface IvyApplicationListener

Parameters:

client - the peer
id
msgarg

directMessage

public void directMessage(IvyClient client, int id, String msgarg)

invoked when a peer sends us a direct message

Specified by:

directMessage in interface IvyApplicationListener

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 )

disconnect

public void disconnect(IvyClient client)

invoked when a Ivy Client has left the bus

Specified by:

disconnect in interface IvyApplicationListener

Parameters:

client - the peer