Interface FlowModelBuilder
- All Known Implementing Classes:
XmlFlowModelBuilder
public interface FlowModelBuilder
Builder interface used to build a flow model. The process of building a flow model consists of the following steps:
- Initialize this builder by calling
init()
. - Call
build()
to create the flow model. - Call
getFlowModel()
to return the fully-builtFlowModel
model. - Dispose this builder, releasing any resources allocated during the building process by calling
dispose()
.
Implementations should encapsulate flow construction logic, either for a specific kind of flow, for example, an
XmlFlowModelBuilder
, for building flows from an XML-definition.
This is a good example of the classic GoF builder pattern.
- Author:
- Keith Donald, Erwin Vervaet, Scott Andrews
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
build()
Builds any variables initialized by the flow when it starts.void
dispose()
Shutdown the builder, releasing any resources it holds.Get the fully constructed flow model.org.springframework.core.io.Resource
Get the underlying flow model resource accessed to build this flow model.boolean
Returns true if the underlying flow model resource has changed since the last call toinit()
.void
init()
Initialize this builder.
-
Method Details
-
init
Initialize this builder. This could cause the builder to open a stream to an externalized resource representing the flow definition, for example.- Throws:
FlowModelBuilderException
- an exception occurred building the flow
-
build
Builds any variables initialized by the flow when it starts.- Throws:
FlowModelBuilderException
- an exception occurred building the flow
-
getFlowModel
Get the fully constructed flow model. Called by the builder's assembler (director) after assembly. When this method is called by the assembler, it is expected flow construction has completed and the returned flow model is ready for use.- Throws:
FlowModelBuilderException
- an exception occurred building this flow
-
dispose
Shutdown the builder, releasing any resources it holds. A new flow construction process should start with another call to theinit()
method.- Throws:
FlowModelBuilderException
- an exception occurred disposing this flow
-
getFlowModelResource
org.springframework.core.io.Resource getFlowModelResource()Get the underlying flow model resource accessed to build this flow model. Returns null if this builder does not construct the flow model from a resource.- Returns:
- the flow model resource
-
hasFlowModelResourceChanged
boolean hasFlowModelResourceChanged()Returns true if the underlying flow model resource has changed since the last call toinit()
. Always returns false if the flow model is not build from a resource.- Returns:
- true if the resource backing the flow model has changed
-