public class FlowAssembler
extends java.lang.Object
FlowBuilder
to construct a flow. This class encapsulates the
algorithm for using a FlowBuilder to assemble a Flow properly. It acts as the director in the classic GoF builder
pattern.
Flow assemblers may be used in a standalone, programmatic fashion as follows:
FlowBuilder builder = ...; FlowBuilder context = ...; Flow flow = new FlowAssembler(builder, builderContext).assembleFlow();
FlowBuilder
Constructor and Description |
---|
FlowAssembler(FlowBuilder flowBuilder,
FlowBuilderContext flowBuilderContext)
Create a new flow assembler that will direct Flow assembly using the specified builder strategy.
|
Modifier and Type | Method and Description |
---|---|
Flow |
assembleFlow()
Assembles the flow, directing the construction process by delegating to the configured FlowBuilder.
|
protected void |
directAssembly()
Build all parts of the flow by directing flow assembly by the flow builder.
|
FlowBuilder |
getFlowBuilder()
Returns the flow builder strategy used to construct the flow from its component parts.
|
FlowBuilderContext |
getFlowBuilderContext()
Returns the flow builder context.
|
public FlowAssembler(FlowBuilder flowBuilder, FlowBuilderContext flowBuilderContext)
flowBuilder
- the builder the factory will use to build flowsflowBuilderContext
- context to influence the build processpublic FlowBuilder getFlowBuilder()
public FlowBuilderContext getFlowBuilderContext()
public Flow assembleFlow() throws FlowBuilderException
This will drive the flow construction process as described in the FlowBuilder
JavaDoc, starting with
builder initialization using FlowBuilder.init(FlowBuilderContext)
and finishing by cleaning up the
builder with a call to FlowBuilder.dispose()
.
FlowBuilderException
- when flow assembly failsprotected void directAssembly() throws FlowBuilderException
FlowBuilderException
- when flow assembly fails