Starting JiniTM Technology Services from the Command Line


Gather the Information You Will Need

Each of the pieces of information that you'll need to gather will be used later in this document as either a command-line option or an argument. For clarity, assume that the Jini software has been extracted in the directory /files, which resulted in the directory /files/jini1_0. In order to start services you will need the absolute paths to the jar files that came as part of the Jini software distribution. So for the duration of these examples, all jar files reside in /files/jini1_0/lib. The current jar files are:

Server Side Client Side Description
jini-core.jar none Core Jini platform interfaces and classes
jini-ext.jar none Jini platform extension interfaces and classes
reggie.jar reggie-dl.jar Jini Lookup service implementation
mahalo.jar mahalo-dl.jar Jini Transaction implementation
outrigger.jar,transient-outrigger.jar outrigger-dl.jar JavaSpaces technology implementation
jini-examples.jar jini-examples-dl.jar Lookup Browser and Service GUI examples
space-examples.jar space-examples-dl.jar JavaSpaces technology examples
tools.jar none ClassServer, DepencyChecker, SerializationChecker
sun-util.jar none Development utilities
pro.zip none ODI classes needed by Outrigger

Note: You will not be able to start a JavaSpaces service unless you have also downloaded and installed the 1.0 release of the JavaSpacesTM Technology Kit (JSTK). The files outrigger.jar, outrigger-dl.jar and transient-outrigger.jar are only available as part of the JSTK.

Set your CLASSPATH

Which of these jar files need to be added to your CLASSPATH?

If you are starting and using the services as provided, nothing needs to be added to your CLASSPATH, because the jar files have been generated in such a way that they contain all the classes they need to run (see below for each service invocation).

If you wish to write your own service or application, then the jar files needed for the service being written need to be added to your CLASSPATH.

For example, if you decide to write your own Jini Lookup service implementation, then you will need to include jini-ext.jar and sun-util.jar files in your CLASSPATH.

Define your security policy

You will need a security policy file because of the security features of JDK1.2. You can find examples of security policy files in several locations:

	/files/jini1_0/example/browser/policy
	/files/jini1_0/example/lookup/policy
	/files/jini1_0/example/lookup/policy.all
    
Note: If you are running on a Win32 platform, then you will need to do one of two things: either use the /files/jini1_0/example/lookup/policy.all file or modify the lines that refer to the lookup service's log directory to accurately reflect your local configuration. For an example of how to modify your policy file click here.

[ Back To Top ]


Start an HTTP Server

An HTTP server is needed for downloading classes that registries and clients will need in order to interact with services. A simple HTTP server is provided to assist you in making the jar files available via httpd, although any web server that can serve documents can be used.

The command-line usage is:

Examples

To start the HTTP server on a specific port:
To start the HTTP server and specify the directory to use as the document root:
To start the HTTP server and log code downloading:
To start the HTTP server, so that for a given class file it will search all the jar files in its document root and download the class it finds:
To start the server with all the above options:

[ Back To Top ]


Start the RMI Activation Daemon

The RMI Activation daemon is needed by Mahalo, Outrigger, and the Jini Lookup service (Reggie).

The activation daemon, rmid, can be found in the bin directory of the JDK1.2 release. Make sure that this bin directory is in your executable path.

The rmid manual page is available for the SolarisTM operating system or for the Win32 platform. For example, to start the RMI activation daemon on the Solaris operating system:

[ Back To Top ]


Start the RMI Registry or the Jini Lookup Service

You can use either the RMI registry or the Jini Lookup service to locate services.

If you have chosen to use the RMI Registry, you can find the rmiregistry executable in the bin directory of the JDK1.2 release. Make sure that this bin directory is in your executable path.

The rmiregistry manual page is available for the SolarisTM operating system or for the Win32 platform. For example, to start the RMI registry on the Solaris operating system:

If you prefer to use the Jini Lookup service, you will need to invoke it in the following way:

The command-line usage is:

For example: Note: If you are running on a Win32 platform, then you will need to do one of two things: either use the /files/jini1_0/example/lookup/policy.all file or modify the lines that refer to the lookup service's log directory to accurately reflect your local configuration.

For example you could change the lines that read,

permission java.io.FilePermission "/tmp/reggie_log", "read,write,delete";
permission java.io.FilePermission "/tmp/reggie_log/-", "read,write,delete";
to:
permission java.io.FilePermission "c:\\temp\\reggie_log", "read,write,delete";
permission java.io.FilePermission "c:\\temp\\reggie_log\\-", "read,write,delete";

[ Back To Top ]


Start a Transaction Manager

The TransactionManager command-line usage is:

Examples

To start a TransactionManager using the RMI Registry:

To start a TransactionManager using the Jini Lookup service:

[ Back To Top ]


Start a JavaSpaces Service

Note: You will not be able to start a JavaSpaces service unless you have also downloaded and installed the 1.0 release of the JavaSpacesTM Technology Kit (JSTK). The files outrigger.jar, outrigger-dl.jar and transient-outrigger.jar are only available as part of the JSTK.

Having started each of the necessary supporting services (a registry service, the activation daemon, and a transaction manager) you are ready to start a space. You will need the following information:

The TransientSpace JavaSpaces service command-line usage is:

The FrontEndSpace JavaSpaces service command-line usage is:

Examples

To start a TransientSpace JavaSpaces service, using the RMI registry:

To start a TransientSpace JavaSpaces service, using the Jini Lookup service:

To start a FrontEndSpace persistent JavaSpaces service, using the using the RMI registry:

To start a FrontEndSpace persistent JavaSpaces service using a Jini Lookup service:

[ Back To Top ]


Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.