Launching and running the application

Here is how we can do this.

First we'll start the launcher and announce which hosting service and SAS we're going to use:


% launcher
Initialising Nodality...
launcher> host {warrant:hosting-warrant.xml}
launcher> sas {warrant:sas-warrant.xml}
SAS warrant recognised: will upload jars
launcher> 

Next we launch the skeleton application. This will upload various JARs, start the application, and download an access point netlet, all of which will take some time:


launcher> run sk skeleton-launcher.xml
Uploading skeleton2                            [5....4....3....2....1....0]
Uploading beatrix                              [5....4....3....2....1....0]
Uploading parser.jar                           [5....4....3....2....1....0]
Uploading libjtrix                             [5....4....3....2....1....0]
Uploading jaxp.jar                             [5....4....3....2....1....0]
Uploading facets1.jar                          [5....4....3....2....1....0]
Waiting for application to initialise... done
launcher> 

The skeleton application has be written with debugging switched on, so you will see lots of debug output in your node window after you launch it.

When the prompt returns we will have become the application's administrator. Then we dump an admin warrant (so we can connect to it again in future). After that we generate a basic consumer-level warrant, connect as a consumer and use the service (i.e. we get the message). Finally, before quitting, we dump the consumer warrant to file, just in case we want to connect to the service in future, or perhaps mail it to a friend. Here's what that all looks like:


launcher> list
sk
launcher> list sk
  Facet: org.jtrix.facets1.service.common.IConsoleFacet
sk.quit - Shut down the application
sk.list-managers - Show all managers and their nodes
sk.list-workers - Show all workers and their nodes
sk.get-warrant - <type> [<service-data>] Get refreshed warrant
sk.set-manager-redundancy - <min> <max> Set the manager redundancy
sk.list-management-state - Display the management state
sk.add-hosting - <id> <warrant> - Add a hosting service to this application
sk.list-hosting - Display the hosting services
launcher> dump $sk skadmin.xml
launcher> bw=`sk.get-warrant skeleton`
launcher> connect skbasic $bw
launcher> list
skbasic
sk
launcher> list skbasic
  Facet: org.jtrix.facets1.service.common.IConsoleFacet
  Facet: org.jtrix.project.skeleton2.facets.ISkeletonFacet
skbasic.getMessage - ( Return: java.lang.String )
launcher> skbasic.getMessage
Hello, skeleton plugin world
launcher> echo $skbasic
<<warrant>>
launcher> dump $bw skbasic.xml
launcher> quit

% 

Even after quitting our warrants will still be on our local file system and usable in case we want to start up the launcher again.

Nik Silver 2002-03-09