uk.org.ogsadai.engine
Interface Engine

All Known Implementing Classes:
RequestEngine

public interface Engine

The engine is one of the core components of OGSA-DAI. It executes requests expressed as OGSA-DAI perform documents to the {#perform()} method below. Upon receiving a request, an implementation may

A request that is currently being processed, alone or concurrently with others, is said to be active. Requests that have been queued or otherwise suspended are inactive.

Author:
The OGSA-DAI Project Team

Method Summary
 int activeLoad()
          Returns the engine's current active load.
 int latentLoad()
          Returns the engine's current latent load.
 void perform(Request request, RequestContext context, ResponseBuilder builder)
          Submits a request, in the form of a request object, and initiates its processing by the engine.
 void terminate()
          Terminates the requests that are currently processing.
 void terminate(SessionID sessionID)
          Terminates any requests that are joined to the specified session.
 

Method Detail

perform

public void perform(Request request,
                    RequestContext context,
                    ResponseBuilder builder)
             throws RequestAuthorizationException,
                    RequestSpecificationException,
                    RequestExecutionException
Submits a request, in the form of a request object, and initiates its processing by the engine.

Parameters:
request - The request to be processed.
context - The context within which the request is to be processed.
builder - ResponseBuilder to use for assembling the response to the request.
Throws:
RequestAuthorizationException - if the request fails because of an authorization problem.
RequestSpecificationException - if the request fails to execute due to a problem in the request e.g. it specifies an unsupported activity or a query expression is has incorrect syntax.
RequestExecutionException - if the request fails to execute due to a problem in the e.g. a database connection disappears or a file is corrupted.

terminate

public void terminate()
Terminates the requests that are currently processing. If no request is processing, no action is taken.


terminate

public void terminate(SessionID sessionID)
Terminates any requests that are joined to the specified session. If there are no requests joined to this session, then no action is taken.

Parameters:
sessionID - The identity of the session

activeLoad

public int activeLoad()
Returns the engine's current active load. An engine's active load is the number of requests that are being actively processed by that engine (i.e. requests that they are no longer being queued or otherwise suspended). An idle engine has an active load of 0. The upper bound on an engine's active load depends on configuration: it equals the maximum number of requests that this instance has been configured to process concurrently. An engine is said to be fully active if it has reached the maximum active load it is capable of.

Returns:
the engine's active load as an int ranging between 0 and the maximum number of requests that this instance can process concurrently.

latentLoad

public int latentLoad()
Returns the engine's current latent load. An engine's latent load is the number of requests that have been received and accepted by the engine but are not as yet being actively processed. The upper bound on an engine's latent load depends on configuration: it equals the maximum number of requests that this instance can still accept whilst being fully active. (An engine is said to be fully active if it has reached the maximum active load it is capable of.)

Returns:
the engine's latent load as an int ranging between 0 and the maximum number of requests that this instance can still accept whilst being fully active.