com.hammurapi.flow.runtime
Interface SynapseFactory<K,S,A>

Type Parameters:
K - Connect key type.
S - Flow state type.
A - Argument type.

public interface SynapseFactory<K,S,A>

Implementations of this interface create invocation interceptors to parallelize and/or distribute computations.

Author:
Pavel Vlasov

Nested Class Summary
static interface SynapseFactory.SynapseConfig
          Synapse config to parameterize synapse.
 
Field Summary
static SynapseFactory.SynapseConfig DEFAULT_SYNAPSE_CONFIG
          Default synapse config - no delay, no repeat, execute asynchronously.
 
Method Summary
 Destroyable connect(Invoker<S,A> invoker, Invocable<S,A> invocable, SynapseFactory.SynapseConfig config, K connectKey, ProcessingPathElement processingPathElement, TaskCounter taskCounter)
          Connects invoker to invocable.
 

Field Detail

DEFAULT_SYNAPSE_CONFIG

static final SynapseFactory.SynapseConfig DEFAULT_SYNAPSE_CONFIG
Default synapse config - no delay, no repeat, execute asynchronously.

Method Detail

connect

Destroyable connect(Invoker<S,A> invoker,
                    Invocable<S,A> invocable,
                    SynapseFactory.SynapseConfig config,
                    K connectKey,
                    ProcessingPathElement processingPathElement,
                    TaskCounter taskCounter)
                    throws ConfigurationException
Connects invoker to invocable.

Parameters:
invoker - Invoker.
invocable - Invocable.
config - Synapse configuration. If null, then DEFAULT_SYNAPSE_CONFIG is used.
connectKey - Connect key.
processingPathElement - Processing path element for the invocable.
taskCounter - Task counter is optionally provided for tracking when all tasks in the flow finish execution.
Returns:
Destroyable to use during flow shutdown for resource cleanup.
Throws:
ConfigurationException