fr.dgac.ivy
Class Probe

java.lang.Object
  |
  +--fr.dgac.ivy.Probe
All Implemented Interfaces:
java.util.EventListener, IvyApplicationListener, IvyBindListener, IvyMessageListener, java.lang.Runnable

public class Probe
extends java.lang.Object
implements IvyApplicationListener, IvyMessageListener, IvyBindListener, java.lang.Runnable


Field Summary
static java.lang.String helpCommands
           
static java.lang.String helpmsg
           
 
Constructor Summary
Probe(java.io.BufferedReader in, boolean timestamp, boolean quiet, boolean debug)
           
 
Method Summary
 void bindPerformed(fr.dgac.ivy.IvyClient client, int id, java.lang.String re)
          invoked when a Ivy Client performs a bind
 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 arg)
          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
static void main(java.lang.String[] args)
           
 void receive(fr.dgac.ivy.IvyClient client, java.lang.String[] args)
          this callback is invoked when a message has been received
 void run()
           
 void setExitOnDie(boolean b)
           
 void start(fr.dgac.ivy.Ivy bus)
           
 void unbindPerformed(fr.dgac.ivy.IvyClient client, int id, java.lang.String re)
          invoked when a Ivy Client performs a unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

helpCommands

public static final java.lang.String helpCommands
See Also:
Constant Field Values

helpmsg

public static final java.lang.String helpmsg
See Also:
Constant Field Values
Constructor Detail

Probe

public Probe(java.io.BufferedReader in,
             boolean timestamp,
             boolean quiet,
             boolean debug)
Method Detail

main

public static void main(java.lang.String[] args)
                 throws IvyException
IvyException

start

public void start(fr.dgac.ivy.Ivy bus)
           throws IvyException
IvyException

setExitOnDie

public void setExitOnDie(boolean b)

run

public void run()
Specified by:
run in interface java.lang.Runnable

bindPerformed

public void bindPerformed(fr.dgac.ivy.IvyClient client,
                          int id,
                          java.lang.String re)
Description copied from interface: IvyBindListener
invoked when a Ivy Client performs a bind

Specified by:
bindPerformed in interface IvyBindListener
Parameters:
client - the peer
re - the regexp

unbindPerformed

public void unbindPerformed(fr.dgac.ivy.IvyClient client,
                            int id,
                            java.lang.String re)
Description copied from interface: IvyBindListener
invoked when a Ivy Client performs a unbind

Specified by:
unbindPerformed in interface IvyBindListener
Parameters:
client - the peer
re - the regexp

connect

public void connect(fr.dgac.ivy.IvyClient client)
Description copied from interface: IvyApplicationListener
invoked when a Ivy Client has joined the bus

Specified by:
connect in interface IvyApplicationListener
Parameters:
client - the peer

disconnect

public void disconnect(fr.dgac.ivy.IvyClient client)
Description copied from interface: IvyApplicationListener
invoked when a Ivy Client has left the bus

Specified by:
disconnect in interface IvyApplicationListener
Parameters:
client - the peer

die

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

Specified by:
die in interface IvyApplicationListener
Parameters:
client - the peer

directMessage

public void directMessage(fr.dgac.ivy.IvyClient client,
                          int id,
                          java.lang.String arg)
Description copied from interface: IvyApplicationListener
invoked when a peer sends us a direct message

Specified by:
directMessage in interface IvyApplicationListener
Parameters:
client - the peer
id -
arg - 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 )

receive

public void receive(fr.dgac.ivy.IvyClient client,
                    java.lang.String[] args)
Description copied from interface: IvyMessageListener
this callback is invoked when a message has been received

Specified by:
receive in interface IvyMessageListener
Parameters:
client - the peer who sent the message
args - the array of string, on string for each subregexp