001 package com.hammurapi.flow.runtime;
002
003 import com.hammurapi.config.bootstrap.ConfigurationException;
004
005 /**
006 * Runtime classes representing nodes shall implements this interface.
007 * @author Pavel Vlasov
008 *
009 * @param <P> Pin type
010 * @param <K> Connect key type.
011 * @param <S> Flow state type.
012 * @param <A> Argument type.
013 */
014 public interface Node<P, K, S, A> extends FlowElement {
015
016 /**
017 * @param pinName Pin name.
018 * @param connectKey Connection key (optional) to distinguish and
019 * configure different outbound transitions.
020 * @return Invoker to connect external invocable to.
021 */
022 Invoker<S, A> getInvoker(String pinName, K connectKey) throws ConfigurationException;
023
024 /**
025 *
026 * @param pinName Pin name.
027 * @param connectKey Connection key (optional) to distinguish different
028 * outbound transitions.
029 * @return Invocable to connect external invoker to.
030 */
031 Invocable<S, A> getInvocable(String pinName, K connectKey) throws ConfigurationException;
032
033 /**
034 * Adds configured pin to the node.
035 * @param pinName Pin name.
036 * @param pin Pin configuration.
037 */
038 void addPin(String pinName, P pinConfig);
039 }