From bba0d7da93db5a33f5a5e16b476d4ac5b5a88be3 Mon Sep 17 00:00:00 2001 From: jestin Date: Wed, 16 Aug 2000 18:08:19 +0000 Subject: First version of java api guide. --- doc/html/guide/advanced.html | 33 +++++++++++ doc/html/guide/basic.html | 121 ++++++++++++++++++++++++++++++++++++++ doc/html/guide/contact.html | 27 +++++++++ doc/html/guide/first.html | 112 +++++++++++++++++++++++++++++++++++ doc/html/guide/index.html | 46 +++++++++++++++ doc/html/guide/ivyTranslater.java | 29 +++++++++ doc/html/guide/javalib.html | 53 +++++++++++++++++ doc/html/guide/style.html | 27 +++++++++ doc/html/guide/what.html | 38 ++++++++++++ 9 files changed, 486 insertions(+) create mode 100644 doc/html/guide/advanced.html create mode 100644 doc/html/guide/basic.html create mode 100644 doc/html/guide/contact.html create mode 100644 doc/html/guide/first.html create mode 100644 doc/html/guide/index.html create mode 100644 doc/html/guide/ivyTranslater.java create mode 100644 doc/html/guide/javalib.html create mode 100644 doc/html/guide/style.html create mode 100644 doc/html/guide/what.html (limited to 'doc/html/guide') diff --git a/doc/html/guide/advanced.html b/doc/html/guide/advanced.html new file mode 100644 index 0000000..385d67b --- /dev/null +++ b/doc/html/guide/advanced.html @@ -0,0 +1,33 @@ + +
++ The Ivy java library guide | ||
---|---|---|
Prev | ++ | Next | +
to be completed + +
Prev | +Home | +Next | +
Basic functions | ++ | Programmer's style guide | +
+ The Ivy java library guide | ||
---|---|---|
Prev | ++ | Next | +
Initializing a java Ivy agent is a two step process. First of all, + you must create an fr.dgac.ivy.Ivy object. Once this object + is created, you can add subscriptions to Ivy events, be it messaged, + arrival or departure of other agents, etc, but your agent is still not + connected. In order to connect, you should call the start() + method on your Ivy object. This will run two threads that will + remain active until you call the stop() method on your Ivy + object. Once the start() method has been called, your agent is ready + to handle messages on the bus ! + +
Here are more details on the Ivy constructor: + +
+ fr.dgac.ivy.Ivy(java.lang.String name, java.lang.String message, IvyApplicationListener appcb)
+ + |
Here are more details on the start() method: +
+public void start(java.lang.String domainbus) throws IvyException
+ + |
If an IvyException is thrown, your application is not able to talk to the + domain bus. + +
Here are more details on the stop() method: +
+public void stop()
+ + |
+public int sendMsg(String s)
+ + |
+public int bindMsg(String regex, IvyMessageListener callback)
+ public void unBindMsg(int id) + + |
Prev | +Home | +Next | +
Your first ivy java application | ++ | Advanced Functions | +
+ The Ivy java library guide | ||
---|---|---|
Prev | ++ | + |
The Ivy C library was mainly written by Francois-Régis Colin, and Yannick Jestin. For bug reports or comments on the library itself or about this document, please send them an email: fcolin@cena.fr and jestin@cena.fr. For comments and ideas about Ivy itself (protocol, applications, etc), please use the Ivy mailing list: ivy@tls.cena.fr. + +
Prev | +Home | ++ |
Previous title | ++ | + |
+ The Ivy java library guide | ||
---|---|---|
Prev | ++ | Next | +
We are going to write a "Hello world translater" for an Ivy bus. The + application will subscribe to all messages starting + with "Hello", and re-emit them after translating "Hello" into "Bonjour". In + addition, the application will quit when it receives any message containing + exactly "Bye". + +
++import fr.dgac.ivy.* ; + +class ivyTranslater implements IvyMessageListener { + + private Ivy bus; + + ivyTranslater() { + // initialization + bus = new Ivy("IvyTranslater","Hello le monde",null); + bus.bindMsg("^Hello(.*)",this); + bus.bindMsg("^Bye$",new IvyMessageListener() { + // callback for "Bye" message + public void receive(IvyClient client, String[] args) {System.exit(0);} + }); + try { + // starts the bus on the default domain or IVY_DOMAIN property + bus.start(null); + } catch (IvyException ie) { + System.err.println("can't run the Ivy bus" + ie.getMessage()); + } + } + + // callback associated to the "Hello" messages" + public void receive(IvyClient client, String[] args) { + bus.sendMsg("Bonjour"+((args.length>0)?args[0]:"")); + } + + public static void main(String args[]) { new ivyTranslater(); } +} ++ |
On a Unix computer, you should be able to compile the application with the + following command : + +
+$ javac ivyTranslater.java
+ $ + |
We are going to test our application with Probe. In a terminal window, + launch ivyTranslater: + +
+$ java ivyTranslater
+ + |
Then in another terminal window, launch Probe. You are then ready to + start, Type "Hello Paul", and you should get "Bonjour Paul". Then Type "Bye", + and your application should quit : + +
+$ java fr.dgac.ivy.Probe '(.*)'
+ you want to subscribe to (.*) + broadcasting on 127.255.255.255:2010 + IvyTranslater connected + IvyTranslater subscribes to ^Bye$ + IvyTranslater subscribes to ^Hello(.*) + IvyTranslater sent 'Hello le monde' + Hello Paul + -> Sent to 1 peers + IvyTranslater sent 'Bonjour Paul' + Bye + -> Sent to 1 peers + IvyTranslater disconnected + <Ctrl-D> + $ + |
Prev | +Home | +Next | +
The Ivy java library | ++ | Basic functions | +
François-Régis Colin
+
Yannick Jestin
+
+
Copyright © 2000 Centre d'Études de la Navigation Aérienne + +
This document is a programmer's guide that describes how to use the Ivy + Java library to connect applications to an Ivy bus. This guide describes + version 3.0 of the library + +
Foreword
+
What is Ivy ?
+
The Ivy java library
+
Your first java ivy application
+
Basic functions
+
Advanced functions
+
Programmer's style guide
+
Contacting the authors
+
+
This document was written in HTML. The authors are aware that this is + probably not the best format for programming documentation, especially with + regard to printing. However, a documentation was needed fast. This document + is both incomplete and ugly. + +
+ The Ivy java library guide | ||
---|---|---|
Prev | ++ | Next | +
The Ivy J library (aka ivy-java) is a java package that allows you to + connect applications to an Ivy bus. You can use it to write applications + in java 1.1 +
You can also use it to integrate any thread-safe java application. +
The Ivy java library is known to compile and work in WindowsNT and Linux + environments. There are reported bugs for the java 2 jdk1.3 platform. + It should be easy to use on most java environments. +
The Ivy java library was originally developed by François-Régis Colin and + Yannick Jestin at CENA. It is maintained by a group at CENA (Toulouse, + France) + +
The package is distributed as a JAR file. In order to use it, either add + it in your CLASSPATH, or put the jar in your $JAVA_HOME/jre/lib/ext/ + directory, if you use a jdk1.2. The package contains the documentation, + the sources and the class files for the fr.dgac.ivy package. +
In order to test the presence of Ivy on your system once installed, run + the following command: +
+$ java fr.dgac.ivy.TestIvy ++ +
Prev | +Home | +Next | +
What is Ivy? | ++ | Your first Ivy application | +
+ The Ivy java library guide | ||
---|---|---|
Prev | ++ | Next | +
to be completed + +
Prev | +Home | +Next | +
Advanced functions | ++ | Contacting the Authors | +
+ The Ivy java library guide | ||
---|---|---|
Prev | ++ | Next | +
Ivy is a software bus designed at CENA (France). A software bus is + a system that allows software applications to exchange information + with the illusion of broadcasting that information, selection being + performed by the receiving applications. Using a software bus is very + similar to dealing with events in a graphical toolkit: on one side, + messages are emitted without caring about who will handle them, and on + the other side, one decide to handle the messages that have a certain + type or follow a certain pattern. Software buses are mainly aimed at + facilitating the rapid development of new agents, and at managing a + dynamic collection of agents on the bus: agents show up, emit messages + and receive some, then leave the bus without blocking the others. + +
Ivy is implemented as a collection of libaries for several languages and platforms. If you want to read more about the principles Ivy before reading this guide of the java library, please refer to The Ivy sofware bus: a white paper. If you want more details about the internals of Ivy, have a look at The Ivy architecture and protocol. And finally, if you are more interested in other languages, refer to other guides such as The Ivy C library guide or The Ivy Perl library guide. All those documents should be available from the Ivy Web site at http://www.tls.cena.fr/products/ivy/. + +
Prev | +Home | +Next | +
The Ivy java library guide | ++ | The Ivy java library | +