diff options
author | jestin | 2001-08-06 14:32:47 +0000 |
---|---|---|
committer | jestin | 2001-08-06 14:32:47 +0000 |
commit | 8fef6a76959160bf73064be48d4aa36b48f27412 (patch) | |
tree | 0302bba851a31c9c75973239364094a2c5fa49cb /doc/html/guide/first.html | |
parent | 5e78d21ce9c03add4bee47b0eb8ab359b639b306 (diff) | |
download | ivy-java-8fef6a76959160bf73064be48d4aa36b48f27412.zip ivy-java-8fef6a76959160bf73064be48d4aa36b48f27412.tar.gz ivy-java-8fef6a76959160bf73064be48d4aa36b48f27412.tar.bz2 ivy-java-8fef6a76959160bf73064be48d4aa36b48f27412.tar.xz |
Theses docs have been removed from this package. What a pity ! They now belong
to the ivy cvsroot. What should I do ?
Diffstat (limited to 'doc/html/guide/first.html')
-rw-r--r-- | doc/html/guide/first.html | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/doc/html/guide/first.html b/doc/html/guide/first.html deleted file mode 100644 index 97ab74c..0000000 --- a/doc/html/guide/first.html +++ /dev/null @@ -1,112 +0,0 @@ -<html> -<head> - <title>your first Ivy java application </title> -</head> -<body> - <table width=100% border=0 cellpadding=0 cellspacing=0><tr><th colspan=3 align=center> - The Ivy java library guide</th></tr><tr> - <td width=10% align=left valign=bottom><a href="javalib.html">Prev</a></td> - <td width=80% align=center valign=bottom> - <td width=10% align=right valign=bottom><a href="basic.html">Next</a></td> - </tr></table><hr> - - <h1>Your first Ivy java application</h1> - - <p>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". - - <h2>The code</h2> - There is the code of <a href="ivyTranslater.java">ivyTranslater.java</a>: - -<TABLE cellpadding=0 cellspacing=0 width=100%> -<tr BGcolor=#e0e0e0 TEXT=#000000><td> -<PRE> -<FONT color=#c000c0>import</FONT> fr.dgac.ivy.* ; - -<FONT color=#008000>class</FONT> ivyTranslater <FONT color=#008000>implements</FONT> IvyMessageListener { - - <FONT color=#008000>private</FONT> Ivy bus; - - ivyTranslater() { - <FONT color=#0000c0>// initialization</FONT> - bus = <FONT color=#804000>new</FONT> Ivy(<FONT color=#c00000>"IvyTranslater"</FONT>,<FONT color=#c00000>"Hello le monde"</FONT>,<FONT color=#c00000>null</FONT>); - bus.bindMsg(<FONT color=#c00000>"^Hello(.*)"</FONT>,<FONT color=#008000>this</FONT>); - bus.bindMsg(<FONT color=#c00000>"^Bye$"</FONT>,<FONT color=#804000>new</FONT> IvyMessageListener() { - <FONT color=#0000c0>// callback for </FONT><FONT color=#c00000>"Bye"</FONT><FONT color=#0000c0> message</FONT> - <FONT color=#008000>public</FONT> <FONT color=#008000>void</FONT> receive(IvyClient client, String[] args) {System.exit(<FONT color=#c00000>0</FONT>);} - }); - <FONT color=#804000>try</FONT> { - <FONT color=#0000c0>// starts the bus on the default domain or IVY_DOMAIN property</FONT> - bus.start(<FONT color=#c00000>null</FONT>); - } <FONT color=#804000>catch</FONT> (IvyException ie) { - System.err.println(<FONT color=#c00000>"can't run the Ivy bus"</FONT> + ie.getMessage()); - } - } - - <FONT color=#0000c0>// callback associated to the </FONT><FONT color=#c00000>"Hello"</FONT><FONT color=#0000c0> messages</FONT><FONT color=#c00000>"</FONT> - <FONT color=#008000>public</FONT> <FONT color=#008000>void</FONT> receive(IvyClient client, String[] args) { - bus.sendMsg(<FONT color=#c00000>"Bonjour"</FONT>+((args.length><FONT color=#c00000>0</FONT>)?args[<FONT color=#c00000>0</FONT>]:<FONT color=#c00000>""</FONT>)); - } - - <FONT color=#008000>public</FONT> <FONT color=#008000>static</FONT> <FONT color=#008000>void</FONT> main(String args[]) { <FONT color=#804000>new</FONT> ivyTranslater(); } -} -</PRE> -</td></tr></table> - - <h2>Compiling</h2> - <p>On a Unix computer, you should be able to compile the application with the - following command : - -<table cellpadding=0 cellspacing=0 width=100%> -<tr bgcolor=#e0e0e0 text=#000000><td> -$ javac ivyTranslater.java -<br>$ -</td></tr></table> - - <h2>Testing</h2> - <p>We are going to test our application with Probe. In a terminal window, - launch ivyTranslater: - -<table cellpadding=0 cellspacing=0 width=100%> -<tr bgcolor=#e0e0e0 text=#000000><td> -$ java ivyTranslater -<br> -</td></tr></table> - - <p>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 : - -<table cellpadding=0 cellspacing=0 width=100%> -<tr bgcolor=#e0e0e0 text=#000000><td> -$ java fr.dgac.ivy.Probe '(.*)' -<br>you want to subscribe to (.*) -<br>broadcasting on 127.255.255.255:2010 -<br>IvyTranslater connected -<br>IvyTranslater subscribes to ^Bye$ -<br>IvyTranslater subscribes to ^Hello(.*) -<br>IvyTranslater sent 'Hello le monde' -<br><b>Hello Paul</b> -<br>-> Sent to 1 peers -<br>IvyTranslater sent 'Bonjour Paul' -<br><b>Bye</b> -<br>-> Sent to 1 peers -<br>IvyTranslater disconnected -<br><Ctrl-D> -<br>$ -</td></tr></table> - - <p><hr><table width=100% border=0 cellpadding=0 cellspacing=0><tr> - <td width=33% align=left valign=top><a href="javalib.html">Prev</a></td> - <td width=34% align=center valign=top><a href="index.html">Home</a></td> - <td width=33% align=right valign=top><a href="basic.html">Next</a></td> - </tr><tr> - <td width=33% align=left valign=top>The Ivy java library</td> - <td width=34% align=center valign=top> </td> - <td width=33% align=right valign=top>Basic functions</a></td> - </tr></table> -</body> -</html> |