|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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.
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:
As the Processlet
lifecycle concept is analogous to that of Java Servlet
s, 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 Servlet
s.
For a more detailed tutorial on implementing your own process please refer to the deegree wiki.
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 |
---|
void process(ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info) throws ProcessletException
ProcessManager
to perform the execution of this Processlet
.
The typical workflow is:
in
parameterout
parameter
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
ProcessletException
- may be thrown by the processlet to indicate a processing exceptionvoid init()
ProcessManager
to indicate to a Processlet
that it is being placed into service.
void destroy()
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |