Search in sources :

Example 1 with FlowAdapter

use of com.sequenceiq.cloudbreak.core.flow2.FlowAdapter in project cloudbreak by hortonworks.

the class AbstractFlowConfiguration method createFlow.

@Override
public Flow createFlow(String flowId, Long stackId) {
    StateMachine<S, E> sm = stateMachineFactory.getStateMachine();
    FlowStructuredEventHandler<S, E> fl = applicationContext.getBean(FlowStructuredEventHandler.class, getEdgeConfig().initState, getEdgeConfig().finalState, getClass().getSimpleName(), flowId, stackId);
    Flow flow = new FlowAdapter<>(flowId, sm, new MessageFactory<>(), new StateConverterAdapter<>(stateType), new EventConverterAdapter<>(eventType), (Class<? extends FlowConfiguration<E>>) getClass(), fl);
    sm.addStateListener(fl);
    return flow;
}
Also used : FlowAdapter(com.sequenceiq.cloudbreak.core.flow2.FlowAdapter) Flow(com.sequenceiq.cloudbreak.core.flow2.Flow)

Aggregations

Flow (com.sequenceiq.cloudbreak.core.flow2.Flow)1 FlowAdapter (com.sequenceiq.cloudbreak.core.flow2.FlowAdapter)1