www.ibm.comLANDP Webpage

LANDP Java Wrappers - Supervisor

SimpleSupervisor is a simple LANDP client that accesses three Supervisor functions:

The client is an example of how to write a LANDP user-written client using the Supervisor class of the LANDP Java wrappers.

Customisation

This client application requires only the LANDP Java Manager and Supervisor servers, and no common definitions are required.

To specify a workgroup for the sample, create a directory in EHCCUS called "LDPJAVA" and in it place a LANCONF.SPC file containing the following definitions:

LANCONF   NAME=LDPJAVA,
WSNAMES=(JJ),
DEFAULTS=GENERAL
LWSCONF NAME=JJ,
TYPE=NT,
SERVER=JAVA,
PAR&JAVA=(Y)

Validate and distribute the files for workstation JJ as normal, and copy the "landpjava" package from the tutorials directory to the workstation directory.

Running the sample

Start LANDP and compile the samples with the following command:

javac -classpath .;LDPJAVA.JAR landpjava\*.java

You can now start the sample application with the following command:

java -classpath .;LDPJAVA.JAR landpjava.SimpleSupervisor

How the sample works

All LANDP client applications must register with the Java manager before they can communicate with LANDP. The RemoteRequest object which is returned is then used as a parameter when initialising the server wrappers so that the server functions are routed through to LANDP correctly.

The connect() function is required before the client application can connect to LANDP services. It is required once the application has successfully registered with the LANDP Java Manager.

The systemStatus() method sets several parameters in the instance of the Supervisor class which has been created, which can be read to determine several parameters, e.g. the local PC ID and type. A Vector is also returned containing information about all the services available in the current workgroup.

The disconnect() function is called when the client application no longer needs to use any LANDP services, and should be called before the application is closed down.

The source code for SimpleSupervisor is provided with this tutorial.

Introduction New to LANDP? Make the most of LANDP Solving LANDP problems Feedback