Field Summary | |
public static final String | DEFAULT_DOMAIN |
the domain for the UDP rendez vous | |
public static final int | DEFAULT_PORT |
the port for the UDP rendez vous, if none is supplied | |
public static final int | PROTOCOLMINIMUM |
public static final int | PROTOCOLVERSION |
the protocol version number | |
public static final int | TIMEOUTLENGTH |
protected int | applicationPort |
protected boolean | doProtectNewlines |
public static final String | libVersion |
the library version, useful for development purposes only, when java is invoked with -DIVY_DEBUG | |
protected String | ready_message |
protected SelfIvyClient | selfIvyClient |
Constructor Summary | |
public | Ivy(String name, String message, IvyApplicationListener appcb) |
Readies the structures for the software bus connexion. |
Method Summary | |
public int | addApplicationListener(IvyApplicationListener callback) |
adds an application listener to a bus | |
public int | addBindListener(IvyBindListener callback) |
adds a bind listener to a bus | |
public int | bindAsyncMsg(String sregexp, IvyMessageListener callback) |
Subscribes to a regular expression with asyncrhonous callback execution. | |
public int | bindMsg(String sregexp, IvyMessageListener callback) |
Subscribes to a regular expression. | |
public int | bindMsg(String sregexp, IvyMessageListener callback, boolean async) |
Subscribes to a regular expression. | |
protected void | clientConnects(IvyClient client) |
protected void | clientDisconnects(IvyClient client) |
protected void | dieReceived(IvyClient client, int id, String message) |
public void | directMessage(IvyClient client, int id, String msgarg) |
public String | domains(String toparse) |
public static String | getDomainArgs(String progname, String args) |
returns the domain bus | |
public static String | getDomain(String domainbus) |
returns the domain bus | |
public Vector | getIvyClientsByName(String name) |
gives a list of IvyClient(s) with the name given in parameter | |
public Vector | getIvyClients() |
gives the names of IvyClient(s) | |
public IvyClient | getSelfIvyClient() |
returns our self IvyClient. | |
protected int | getSerial() |
public boolean | isSendToSelf() |
public static void | main(String args) |
public fr.dgac.ivy.Ivy.Domain | parseDomains(String domainbus) |
public void | protectNewlines(boolean b) |
Toggles the encoding/decoding of messages to prevent bugs related to the presence of a "\n" | |
protected void | regexpDeleted(IvyClient client, int id, String sregexp) |
protected void | regexpReceived(IvyClient client, int id, String sregexp) |
public void | removeApplicationListener(int id) |
removes an application listener | |
public void | removeBindListener(int id) |
removes a bind listener | |
public void | run() |
public int | sendMsg(String message) |
Performs a pattern matching according to everyone's regexps, and sends the results to the relevant ivy agents. | |
public void | sendToSelf(boolean b) |
Toggles the sending of messages to oneself, the remote client's IvyMessageListeners are processed first, and ourself afterwards. | |
public void | start(String domainbus) |
connects the Ivy bus to a domain or list of domains. | |
public void | stop() |
disconnects from the Ivy bus | |
public void | unBindMsg(int id) |
unsubscribes a regular expression | |
public boolean | unBindMsg(String re) |
unsubscribes a regular expression | |
public IvyClient | waitForClient(String name, int timeout) |
Waits for an other IvyClient to join the bus | |
public IvyClient | waitForMsg(String regexp, int timeout) |
Waits for a message to be received |
public static final DEFAULT_DOMAIN
public static final DEFAULT_PORT
public static final PROTOCOLMINIMUM
public static final PROTOCOLVERSION
public static final TIMEOUTLENGTH
protected applicationPort
protected doProtectNewlines
public static final libVersion
protected ready_message
protected selfIvyClient
public Ivy(String name, String message, IvyApplicationListener appcb)
public int addApplicationListener(IvyApplicationListener callback)
public int addBindListener(IvyBindListener callback)
public int bindAsyncMsg(String sregexp, IvyMessageListener callback)
public int bindMsg(String sregexp, IvyMessageListener callback)
b.bindMsg("^Hello (*)",cb);
b2.sendMsg("Hello world");
public int bindMsg(String sregexp, IvyMessageListener callback, boolean async)
b.bindMsg("^Hello (*)",cb);
b2.sendMsg("Hello world");
protected void dieReceived(IvyClient client, int id, String message)
public void directMessage(IvyClient client, int id, String msgarg)
public String domains(String toparse)
public static String getDomainArgs(String progname, String args)
public static String getDomain(String domainbus)
public Vector getIvyClientsByName(String name)
public Vector getIvyClients()
protected int getSerial()
public boolean isSendToSelf()
public static void main(String args)
public fr.dgac.ivy.Ivy.Domain parseDomains(String domainbus)
public void protectNewlines(boolean b)
protected void regexpDeleted(IvyClient client, int id, String sregexp)
protected void regexpReceived(IvyClient client, int id, String sregexp)
public void removeApplicationListener(int id)
public void removeBindListener(int id)
public void run()
public int sendMsg(String message)
public void sendToSelf(boolean b)
public void start(String domainbus)
public void stop()
public void unBindMsg(int id)
public boolean unBindMsg(String re)
public IvyClient waitForClient(String name, int timeout)
public IvyClient waitForMsg(String regexp, int timeout)