/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.
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
.
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.allNote: 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.
The command-line usage is:
java -jar
<tools-jarfile> [-port <port-number>] <-dir document-root-dir> [-trees] [-verbose]
- The default port number is 8080
java -jar
/files/jini1_0/lib/tools.jar
-port 80
java -jar
/files/jini1_0/lib/tools.jar
-dir /files/jini1_0/lib
java -jar
/files/jini1_0/lib/tools.jar
-verbose
java -jar
/files/jini1_0/lib/tools.jar
-trees
java -jar
/files/jini1_0/lib/tools.jar
-port 9090
-dir /files/jini1_0/lib
-trees
-verbose
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:
rmid &
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:
rmiregistry &
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:
java -jar
<lookup-server-jarfile> <lookup-client-codebase> <lookup-policy-file> <output-log-dir> <lookup-service-group>Note: If you are running on a Win32 platform, then you will need to do one of two things: either use the
java -jar /files/jini1_0/lib/reggie.jar http://'hostname':8080/reggie-dl.jar /files/jini1_0/example/lookup/policy /tmp/reggie_log public
/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";
The TransactionManager
command-line usage is:
java -jar
<policy-property>
<use-rmi-registry-property>
[rmi-registry-port-property]
<txn-manager-name-property>
<txn-manager-server-jarfile>
<txn-manager-client-codebase>
<security-policy-file>
<absolute-path-to-txn-log-dir>
[lookup-service-group]
TransactionManager
using the RMI Registry:
java -jar
-Djava.security.policy=/files/jini1_0/example/txn/policy.all
-Dcom.sun.jini.use.registry=yes
-Dcom.sun.jini.rmiregistryport=1099
-Dcom.sun.jini.mahalo.managerName=TransactionManager
/files/jini1_0/lib/mahalo.jar
http://'hostname':8080/mahalo-dl.jar
/files/jini1_0/example/txn/policy.all
/tmp/txn_log
To start a TransactionManager
using the Jini Lookup service:
java -jar
-Djava.security.policy=/files/jini1_0/example/txn/policy.all
-Dcom.sun.jini.mahalo.managerName=TransactionManager
/files/jini1_0/lib/mahalo.jar
http://'hostname':8080/mahalo-dl.jar
/files/jini1_0/example/txn/policy.all
/tmp/txn_log
public
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:
java -jar
<security-policy-property>
<use-rmi-registry-property>
[rmi-registry-port-property]
<javaspace-client-codebase-property>
<javaspace-name-property>
<javaspace-server-jarfile>
[lookup-service-group]
FrontEndSpace
JavaSpaces service
command-line usage is:
java -jar
<security-policy-property>
<use-rmi-registry-property>
[rmi-registry-port-property]
<javaspace-name-property>
<javaspace-server-jarfile>
<javaspace-client-codebase>
<security-policy-file>
<persistent-log-dir>
[lookup-service-group]
TransientSpace
JavaSpaces service, using the
RMI registry:
java -jar
-Djava.security.policy=/files/jini1_0/example/books/policy.all
-Dcom.sun.jini.use.registry=yes
-Dcom.sun.jini.rmiregistryport=1099
-Djava.rmi.server.codebase=http://'hostname':8080/outrigger-dl.jar
-Dcom.sun.jini.outrigger.spaceName=JavaSpaces
/files/jini1_0/lib/transient-outrigger.jar
To start a TransientSpace
JavaSpaces service, using the
Jini Lookup service:
java -jar
-Djava.security.policy=/files/jini1_0/example/books/policy.all
-Djava.rmi.server.codebase=http://'hostname':8080/outrigger-dl.jar
-Dcom.sun.jini.outrigger.spaceName=JavaSpaces
/files/jini1_0/lib/transient-outrigger.jar
public
To start a FrontEndSpace
persistent JavaSpaces
service, using the using the RMI registry:
java -jar
-Djava.security.policy=/files/jini1_0/example/books/policy.all
-Dcom.sun.jini.use.registry=yes
-Dcom.sun.jini.rmiregistryport=1099
-Dcom.sun.jini.outrigger.spaceName=JavaSpaces
/files/jini1_0/lib/outrigger.jar
http://'hostname':8080/outrigger-dl.jar
/files/jini1_0/example/books/policy.all
/tmp/persistentlogdir
To start a FrontEndSpace
persistent JavaSpaces
service using a Jini Lookup service:
java -jar
-Djava.security.policy=/files/jini1_0/example/books/policy.all
-Dcom.sun.jini.outrigger.spaceName=JavaSpaces
/files/jini1_0/lib/outrigger.jar
http://'hostname':8080/outrigger-dl.jar
/files/jini1_0/example/books/policy.all
/tmp/persistentlogdir
public