org.deegree.services.wps
Interface Processlet

All Known Subinterfaces:
ExceptionAwareProcesslet

public interface Processlet

Implementations of this interface are (usually GIS-related) processes that can be registered in the deegree WPS, so they can be accessed over the web by the means of the OpenGIS Web Processing Service protocol.

Processes, Processlets and the WPS

A Processlet may offer calculations as simple as subtracting one set of spatially referenced numbers from another (e.g., determining the difference in influenza cases between two different seasons), or as complicated as a global climate change model.

The deegree WPS is a feature-complete, efficient and scalable container for processlets (Java classes implementing the Processlet interface). The WPS handles the protocol as defined by the OGC Web Processing Service specification while a Processlet implements the computational logic of a concrete process.

A deegree WPS process consists of a Java class implementing the Processlet interface and an XML configuration file that has to validate against http://schemas.deegree.org/wps/0.5.0/process_definition.xsd). Besides the definition of metadata, the XML configuration file references the implementation class with its fully qualified class name.

Accessing the input and output parameters of the Processlet

NOTE: The Processlet code must never create the input and output parameter objects manually -- they are instantiated by the WPS automatically and given as parameters to the process(ProcessletInputs, ProcessletOutputs, ProcessletExecutionInfo) method. A Processlet just needs to retrieve the parameter objects that it expects and read/set their values.

It is essential to know the relevant interfaces for dealing with input and output data. For input data, please refer to:

For output data, please refer to:

Notes on thread-safety

As the Processlet lifecycle concept is analogous to that of Java Servlets, the implementer is responsible of ensuring thread-safety: The container only creates one instance of a specific Processlet, regardless of the number of simultaneous executions. This implies that the implementation of the process(ProcessletInputs, ProcessletOutputs, ProcessletExecutionInfo) method must not change any static or member variables to perform the computation. If you're unsure about this, please check out documentation on the thread-safe implementation of Servlets.

For a more detailed tutorial on implementing your own process please refer to the deegree wiki.

Version:
$Revision: 25786 $, $Date: 2010-08-09 19:55:41 +0200 (Mo, 09. Aug 2010) $
Author:
Alexander Padberg, Markus Schneider, last edited by: $Author: mschneider $

Method Summary
 void destroy()
          Called by the ProcessManager to indicate to a Processlet that it is being taken out of service.
 void init()
          Called by the ProcessManager to indicate to a Processlet that it is being placed into service.
 void process(ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info)
          Called by the ProcessManager to perform the execution of this Processlet.
 

Method Detail

process

void process(ProcessletInputs in,
             ProcessletOutputs out,
             ProcessletExecutionInfo info)
             throws ProcessletException
Called by the ProcessManager to perform the execution of this Processlet.

The typical workflow is:

  1. Get inputs from in parameter
  2. Parse inputs into the required format (e.g. GML)
  3. Do computation.
  4. Transform computational results into required format (e.g. GML)
  5. Write results to out parameter
Please consider the corresponding wiki howto.

Parameters:
in - input arguments to be processed, never null
out - used to store the process outputs, never null
info - can be used to provide execution information, i.e. percentage completed and start/success messages that it wants to make known to clients, never null
Throws:
ProcessletException - may be thrown by the processlet to indicate a processing exception

init

void init()
Called by the ProcessManager to indicate to a Processlet that it is being placed into service.


destroy

void destroy()
Called by the ProcessManager to indicate to a Processlet that it is being taken out of service.

This method gives the Processlet an opportunity to clean up any resources that are being held (for example, memory, file handles, threads) and make sure that any persistent state is synchronized with the Processlet's current state in memory.



Copyright © 2011. All Rights Reserved.