com.hammurapi.flow.runtime
Interface Invocable<S,A>

Type Parameters:
S - Flow state type.
A - Argument type.

public interface Invocable<S,A>

Extended invocation semantics to use in flow execution.

Author:
Pavel

Method Summary
 Collection<Future<?>> invoke(S flowState, A[] args, PropertySet properties, Context context, List<ProcessingPathElement> processingPath)
          Invokes this invocable.
 

Method Detail

invoke

Collection<Future<?>> invoke(S flowState,
                             A[] args,
                             PropertySet properties,
                             Context context,
                             List<ProcessingPathElement> processingPath)
                             throws Exception
Invokes this invocable.

Parameters:
flowState - Shared object available to all invocations during execution. Drawing an analogy with object-oriented programming, flow definition corresponds to class, and flowState corresponds to instance of the class, which keeps state.
args - Arguments. If one or more arguments are instances of TokenIterator, then synapses shall iterate over them and invoke connected invocable for each element returned by TokenIterator.next(). In this case invoke returns a collection of futures with size greater than one.
properties - Property set.
context - Context.
processingPath - Processing path. The purpose of processingPath is similar to the purpose of stack trace. This argument shall not be used in flow elements logic. Synapses modify this element by adding information about processing steps, and throw exception if the path becomes too long (infinite loop).
Returns:
Collection of futures.
Throws:
Exception