org.geotoolkit.process
Interface Process

All Superinterfaces:
Callable<ParameterValueGroup>

public interface Process
extends Callable<ParameterValueGroup>

An operation applied to some given data to achieve whatever analyze or model transformation. Process instances are created by ProcessDescriptor and can be executed in an ExecutorService.


Event notifications
All Process implementations must notify all their ProcessListeners when the call() method is starting and when it is terminating, either successfully or on failure.

Since:
3.19
Version:
3.19
Author:
Johann Sorel (Geomatys)
See Also:
ExecutorService
Module:
utility/geotk-utility (download)    View source code for this class

Method Summary
 void addListener(ProcessListener listener)
          Adds a listener to the list of objects to inform about the process progress.
 ParameterValueGroup call()
          Executes the process and returns the output in a new ParameterValueGroup.
 ProcessDescriptor getDescriptor()
          Description of the process algorithm and its input/output parameters.
 ParameterValueGroup getInput()
          Returns the input values given to the ProcessDescriptor.createProcess(ParameterValueGroup) method.
 ProcessListener[] getListeners()
          Returns all registered listeners, or an empty array if none.
 void removeListener(ProcessListener listener)
          Removes a listener from the list of objects to inform about the process progress.
 

Method Detail

getDescriptor

ProcessDescriptor getDescriptor()
Description of the process algorithm and its input/output parameters. The returned value is the descriptor that created this Process instance.

Returns:
The process descriptor.

getInput

ParameterValueGroup getInput()
Returns the input values given to the ProcessDescriptor.createProcess(ParameterValueGroup) method. The descriptor of those parameters is the instance returned by getDescriptor().getInputDescriptor().

Returns:
The input parameter values (never null).
See Also:
ProcessDescriptor.getInputDescriptor(), ProcessStep.getSources()

call

ParameterValueGroup call()
                         throws ProcessException
Executes the process and returns the output in a new ParameterValueGroup. Some details about the work which has been performed (processing date, reports, etc.) may be included as a ProcessStep instance associated to the ProcessDescriptor.PROCESS_STEP parameter descriptor.
Note: Returning a parameter object may sound strange, since parameters are usually for input values rather than output values. Note however that ISO 19115 do the same, since the ProcessStep outputs is a collection of Source objects. In both cases, the outputs may be used as inputs in the next step of a process chain.
The following relations shall hold:

Event notifications
For any registered listeners, this method shall invoke the following methods. Note that all notification events except progressing are mandatory for all Process implementations.

Specified by:
call in interface Callable<ParameterValueGroup>
Returns:
The computation results as an parameter value groups.
Throws:
ProcessException - if the process failed.
See Also:
ProcessDescriptor.getOutputDescriptor(), ProcessStep.getOutputs()

addListener

void addListener(ProcessListener listener)
Adds a listener to the list of objects to inform about the process progress.

Parameters:
listener - The listener to add.

removeListener

void removeListener(ProcessListener listener)
Removes a listener from the list of objects to inform about the process progress.

Parameters:
listener - The listener to remove.

getListeners

ProcessListener[] getListeners()
Returns all registered listeners, or an empty array if none.

Returns:
The registered listeners.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.