Utilities for Interaction with the System

Document #: 231ZR011
Authors: N. Asokan (ZRL)
Editor: N. Asokan (ZRL)
Reviewer: CRM
Status: Draft Version. 1, SEMPER internal
Date: April 25, 1997


Abstract

This document describes the semper.util.system package which contains various utilities to allows SEMPER objects to interact with the external system on which they are running. For example, this package provides a front-end to set environement variables.

Introduction

This document describes the semper.util.system package which contains various utilities to allows SEMPER objects to interact with the external system on which they are running. The version of this document in the source directory of the semper.util.system block may be more up to date. Currently, there are three main classes providing services:

Environment Interaction

Many modules that can be used within SEMPER often make use of environmental variables to configure their behaviour. At the time of installing the module, it is usually possible to figure out what the value of the environment variables of interest should be for the particular user's configuration.

The Env class provides services intended to be used by module installation programs. The installation programs can determine the values of the environment variables they want to use and register (variable name, value) pairs with using the setEnvVar method. This method also takes the name of the creator as a parameter. Only the creator of an environment variable can change it or unset it. Currently, there is no authentication or other forms of access control used.

Once registered, the variable is set with the proposed value in the system environment right away. Thereafter, until the name is unregistered, the variable will be set each time SEMPER starts up.

Usage Exampe

Suppose a module supplied by "ZRL" wants to make use of an environment variable called SDK_DATABASE_LOCATION. At installation time, the module installation programs queries the user and determines that this variable must be set to /tmp/mydatabase". It can register this information using:
Env.setEnvVar("SDK_DATABASE_LOCATION", "/tmp/mydatabase", "ZRL");

See documentation on the semper.util.Install package for more information on how to write module installation programs.

FileCopy

For some reason, JDK does not provide services to copy files and directories.FileCopy is a freely distributed implementation of this functionality obtained from the Gamelan archives.

Miscellanous Services

The Misc class is a grabbag of tools to supplement missing functionality in stock Java environment. Currently, the following services are available:

Miscellany

The system interaction utilities are in the package semper.util.system. The documentation includes an index and a tree depicting the class structure.