SAGA Java language bindings, version-1.1.1

This overview discusses some of the general, Java-specific design considerations for the classes and interfaces from the language-independent SAGA specification (GFD.90).

See:
          Description

Packages
org.ogf.saga This package contains the base object for almost all SAGA objects.
org.ogf.saga.attributes There are various places in the SAGA API where attributes need to be associated with objects, for instance for job descriptions and metrics.
org.ogf.saga.bootstrap This package contains the bootstrap mechanism which connects a SAGA application, written on top of the SAGA Java language bindings, to a specific SAGA implementation.
org.ogf.saga.buffer This package provides the Buffer interface.
org.ogf.saga.context This package contains the Context interface, which provides a common interface for storing security information.
org.ogf.saga.error Each SAGA API call has an associated list of exceptions it may throw, which are described in this package.
org.ogf.saga.file This package provides classes to manipulate the contents of directories or files.
org.ogf.saga.isn Provides interfaces to retrieve data from an information model.
org.ogf.saga.job The job package describes the API for submitting jobs to a grid resource.
org.ogf.saga.logicalfile This package provides classes to interact with replica systems.
org.ogf.saga.monitoring The monitoring package defines the Monitorable interface, which must be implemented by monitorable SAGA objects, and also defines the Steerable interface, which extends the monitoring mechanism with the ability to push values back to the monitored entity.
org.ogf.saga.namespace This package provides classes to manipulate namespaces.
org.ogf.saga.permissions The permissions package provides the interface Permissions to query and set permissions on Saga objects, such as files or streams.
org.ogf.saga.rpc The methods of the SAGA RPC package map with the methods as defined in the GridRPC specification, as described in GFD.52, at least semantically, with slight modifications for SAGA look and feel, SAGA error conventions, SAGA task model, et cetera.
org.ogf.saga.sd This API provides a mechanism to locate services.
org.ogf.saga.session This package contains the Session interface, which provides a common interface for managing security information (by storing Context objects).
org.ogf.saga.stream The streams package provides a simple mechanism for setting up connections to remote components.
org.ogf.saga.task This package provides classes and methods for manipulating tasks and collections of tasks.
org.ogf.saga.url The methods of the SAGA URL package allow access to the parts of an URL.

 

This overview discusses some of the general, Java-specific design considerations for the classes and interfaces from the language-independent SAGA specification (GFD.90).

Java language version

The Java language version used is the one provided in J2SE 5.0 This version of the Java language is widely available and, in contrast to earlier versions, this version provides generics and enumerated types, features used in the SAGA language bindings for Java. Also, this version provides the java.util.concurrent package, which is not available in earlier versions, and which is used for the Java language bindings of SAGA tasks.

Identifiers

Various identifiers as used in the language-independent SAGA specification are changed slightly to obey Java conventions (for instance, set_data became setData, enumeration literals are completely capitalized) or to avoid conflicts with already existing method names (wait is replaced by waitFor).

Concurrency control and thread-safety

Java SAGA implementations must be thread-safe. Multiple application threads are allowed to access a common SAGA object. However, no particular order is enforced, unless the application itself does so.

File I/O and Java file streams

Earlier experience with JavaGAT has shown that having implementations of the Java streams InputStream and OutputStream is very much appreciated by Java application programmers, since these are the types on which most Java I/O is based. Therefore, it was decided to add specifications for FileInputStream and FileOutputStream to the file package. The File class as specified in the SAGA specifications is also specified in the Java language bindings. Of course, implementations and factories may throw the NotImplementedException exception when methods or complete classes cannot be implemented.

Also, methods were added to Stream to obtain the usual java IO streams.

Error handling

The SAGA specifications refer to POSIX error return codes for several methods. However, it is not to be expected that these will be available in existing Java Grid middleware. Also, in Java, error conditions are supposed to be passed on by means of exceptions. Therefore, it was decided that where the SAGA specifications refer to POSIX error codes, a SagaIOException is to be thrown in these cases. If an error code is available, it is stored in the exception object.

Features unavailable in Java: permissions, links

For some features of the SAGA specifications, most notably permissions and links, Java just does not provide building blocks, even locally. Java is not a systems programming language. Nevertheless, all methods concerning links and permissions are specified in the Java language bindings. SAGA application writers should not be surprised, however, if SAGA implementations throw a NotImplemented exception when these methods are invoked.

Prescribing the API for applications and SAGA implementors

The aim of having bindings of the SAGA API specification to certain programming languages is to define the precise syntax and semantics of the SAGA functionality, in the given language. This language binding can be seen as a contract between applications and SAGA implementors: both parties can safely assume that exactly the classes and interfaces described in this document will be either provided or requested for.

For facilitating both application writing and implementing SAGA, providing the Java language binding in the form of directly usable files is considered important. It has been decided to provide both interfaces and classes from the language-independent SAGA specification in the form of Java interfaces. This leaves SAGA implementations with the task of writing classes that implement these interfaces. For allowing applications to create SAGA objects, the interfaces are accompanied by factory classes. Java implementations of SAGA must implement the interfaces and factories as specified here.

This setup requires a bootstrap mechanism for creating factory objects. This is realized with the SagaFactory interface, and the ImplementationBootstrapLoader class, as described here. This mechanism uses the saga.factory system property, to be set by the user to point to an implementation-specific metafactory, which in turn has methods to create factories for all SAGA packages.



The SAGA Java language bindings, version-1.1.1