aboutsummaryrefslogtreecommitdiff
path: root/src/IvyApplicationListener.java
blob: 1f4303e4542b71e1d4891cf0b88b1e32cd28e8e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
 * this interface specifies the methods of an ApplicationListener
 * @see IvyApplicationAdapter
 *
 * @author	Francois-Rzgis Colin
 * @author	Yannick Jestin
 * @author	<a href="http://www.tls.cena.fr/products/ivy/">http://www.tls.cena.fr/products/ivy/</a>
 *
 * The ApplicatinListenr  for receiving application level events on the Ivy
 * bus: connexion, disconnexion, direct messages or requests to quit. 
 *
 * Changelog:
 * 1.2.8
 *   - removed the public abstract modifiers, which are redundant
 * 1.2.4
 *   - sendDie now requires a String argument ! It is MANDATORY, and could
 *   impact your implementations !
 */
package fr.dgac.ivy;

public interface IvyApplicationListener extends java.util.EventListener {
  /**
   * invoked when a Ivy Client has joined the bus
   * @param client the peer
   */
  void connect(IvyClient client);
  /**
   * invoked when a Ivy Client has left the bus
   * @param client the peer
   */
  void disconnect(IvyClient client);
  /**
   * invoked when a peer request us to leave the bus
   * @param client the peer
   */
  void die(IvyClient client, int id,String msgarg);
  /**
   * invoked when a peer sends us a direct message
   * @param client the peer
   * @param id 
   * @param 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 )
   */
  void directMessage( IvyClient client, int id,String msgarg );
}