Creating the netlet descriptor
We use jtrixmaker to create our netlet descriptor. Here's all
the information we need to give it:
- What type of thing we're making. In this case, a netlet descriptor.
(The program can make more other things, too.)
- What we want the resulting netlet descriptor to be called. In this
case, hello1-client.xml.
- Where jtrixmaker can find the various JARs the netlet will
use. Most of our Jtrix JARs are in /usr/lib/jtrix (this might
be different on your system), but hello1.jar is in our current
directory (called ``.''), so we have to name that, too.
- Which JARs are needed to run the netlet. Certainly hello1.jar
is needed, and also libjtrix.jar. But we don't have to name
jtrix.jar because we can always assume it will be on whatever
system we happen to be running on.
- What the main class is going to be, the one which is the INetlet.
In this case it's Hello1Client which of course we have to
specify with its full name.
- Any parameter we need to pass in to the netlet's initialise()
method. In our case we need the warrant we put into the file hello-warrant.xml.
If you don't already have it, get it from http://www.jtrix.org/warrant/hello-warrant.xml.
And with all that we can generate the netlet descriptor like this:
% ls
hello-warrant.xml hello1.jar
% jtrixmaker -type netlet -outfile hello1-client.xml \
-jardirs /usr/lib/jtrix . -jars libjtrix.jar hello1.jar \
-classname org.jtrix.project.helloworld.Hello1Client \
-param {warrant:hello-warrant.xml}
% ls
hello-warrant.xml hello1-client.xml hello1.jar
%
As we can see, the descriptor XML is created and we can move on to
run it.
Nik Silver
2002-03-09