Mercurial > hg > blitz_stable
comparison docs/hello_example.html @ 0:3dc0c5604566
Initial checkin of blitz 2.0 fcs - no installer yet.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Sat, 21 Mar 2009 11:00:06 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3dc0c5604566 |
---|---|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
2 <html> | |
3 <head> | |
4 <title>Blitz HelloWorld Example</title> | |
5 <link rel="stylesheet" type="text/css" href="ssl.css" /> | |
6 </head> | |
7 <body> | |
8 <h1>Blitz HelloWorld Example</h1> | |
9 | |
10 <h2>Introduction</h2> | |
11 | |
12 <p>This example provides a simple demonstration of how to use a JavaSpace (it is not Blitz specific). | |
13 </p> | |
14 | |
15 <h2>Compiling</h2> | |
16 | |
17 The example consists of four classes: | |
18 | |
19 <ol> | |
20 <li><a href="../examples/helloworld/Lookup.java">Lookup</a> which handles service lookup.</li> | |
21 <li><a href="../examples/helloworld/Writer.java">Writer</a> which generates Entry's.</li> | |
22 <li><a href="../examples/helloworld/Taker.java">Taker</a> which takes Entry's.</li> | |
23 <li><a href="../examples/helloworld/TestEntry.java">TestEntry</a> which is the Entry class.</li> | |
24 </ol> | |
25 | |
26 In order to compile these classes you will require the following <code>.jar</code>'s: | |
27 | |
28 <ul> | |
29 <li><code>jsk-lib.jar, jsk-platform.jar from the JINI 2.x distribution.</li> | |
30 </ul> | |
31 | |
32 Assuming that your JINI 2.1 distribution is in <code>/jini2_1</code> and your Blitz distribution is in <code>/blitz</code>, you can compile the example as follows: | |
33 | |
34 <pre> | |
35 cd /blitz/examples/helloworld | |
36 | |
37 javac -classpath /jini2_1/lib/jsk-lib.jar:/jini2_1/lib/jsk-platform.jar *.java | |
38 </pre> | |
39 | |
40 <h2>Running</h2> | |
41 | |
42 <p>Before starting the example, ensure that you have a Blitz instance running in a public lookup group - see the <a href="install_guide.html">Installation Guide</a>. This is necessary because the <code>Lookup</code> class does a single lookup and discover step - it does not register with discovered lookup services. Thus, if a Blitz instance isn't registered beforehand, it will not be found (I'll fix this in a future release!).</p> | |
43 | |
44 <p>We are now ready to run the example. First, we'll start the taker - open a new terminal window and then: | |
45 </p> | |
46 | |
47 <pre> | |
48 cd /blitz | |
49 | |
50 java -Djava.security.policy=config/policy.all -classpath /jini2_1/lib/jsk-lib.jar:/jini2_1/lib/jsk-platform.jar:/blitz/examples/ helloworld.Taker | |
51 </pre> | |
52 | |
53 Now we'll run the Writer - open a new terminal window and then: | |
54 | |
55 <pre> | |
56 cd /blitz | |
57 | |
58 java -Djava.security.policy=config/policy.all -classpath /jini2_1/lib/jsk-lib.jar:/jini2_1/lib/jsk-platform.jar:/blitz/examples/ helloworld.Writer | |
59 </pre> | |
60 | |
61 <p>The Taker will exit automatically when it hasn't taken an Entry in the last 60 seconds.</p> | |
62 | |
63 <h2>More Material</h2> | |
64 | |
65 <p>For more examples see:</p> | |
66 | |
67 <ol> | |
68 <li><a href="http://www.incax.com/examples.htm#jsip">JavaSpaces in Practice Examples</a></li> | |
69 <li><a href="https://bodega.dev.java.net/">Bodega Project</a></li> | |
70 </ol> | |
71 | |
72 <p>For JavaSpaces resources see <a href="http://www.dancres.org/cottage/javaspaces.html">here</a></p> | |
73 | |
74 <p><div align="center"><a href="../index.html">Back to Documentation</a></div></p> | |
75 </body> | |
76 </html> |