Spring Web Flow

org.springframework.webflow.engine.builder
Class DefaultFlowHolder

java.lang.Object
  extended by org.springframework.webflow.engine.builder.DefaultFlowHolder
All Implemented Interfaces:
FlowDefinitionHolder

public class DefaultFlowHolder
extends java.lang.Object
implements FlowDefinitionHolder

A flow definition holder that can detect changes on an underlying flow definition resource and refresh that resource automatically.

This class is thread-safe.

Note that this FlowDefinition holder uses a FlowAssembler. This class bridges the abstract world of flow definitions with the concrete world of flow implementations.

Author:
Keith Donald
See Also:
FlowAssembler, FlowDefinition

Constructor Summary
DefaultFlowHolder(FlowAssembler assembler)
          Creates a new refreshable flow definition holder that uses the configured assembler (GOF director) to drive flow assembly, on initial use and on any resource change or refresh.
 
Method Summary
 void destroy()
          Indicates that the system is being shutdown and any resources flow resources should be released.
 FlowDefinition getFlowDefinition()
          Returns the flow definition held by this holder.
 java.lang.String getFlowDefinitionId()
          Returns the id of the flow definition held by this holder.
 java.lang.String getFlowDefinitionResourceString()
          Returns a descriptive string that identifies the source of this FlowDefinition.
 void refresh()
          Refresh the flow definition held by this holder.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultFlowHolder

public DefaultFlowHolder(FlowAssembler assembler)
Creates a new refreshable flow definition holder that uses the configured assembler (GOF director) to drive flow assembly, on initial use and on any resource change or refresh.

Parameters:
assembler - the flow assembler to use
Method Detail

getFlowDefinitionId

public java.lang.String getFlowDefinitionId()
Description copied from interface: FlowDefinitionHolder
Returns the id of the flow definition held by this holder. This is a lightweight method callers may call to obtain the id of the flow without triggering full flow definition assembly (which may be an expensive operation).

Specified by:
getFlowDefinitionId in interface FlowDefinitionHolder

getFlowDefinitionResourceString

public java.lang.String getFlowDefinitionResourceString()
Description copied from interface: FlowDefinitionHolder
Returns a descriptive string that identifies the source of this FlowDefinition. This is also a lightweight method callers may call to obtain the logical resource where the flow definition resides without triggering flow definition assembly. Used for informational purposes.

Specified by:
getFlowDefinitionResourceString in interface FlowDefinitionHolder
Returns:
the flow definition resource string

getFlowDefinition

public FlowDefinition getFlowDefinition()
                                 throws FlowDefinitionConstructionException
Description copied from interface: FlowDefinitionHolder
Returns the flow definition held by this holder. Calling this method the first time may trigger flow assembly (which may be expensive).

Specified by:
getFlowDefinition in interface FlowDefinitionHolder
Throws:
FlowDefinitionConstructionException - if there is a problem constructing the target flow definition

refresh

public void refresh()
             throws FlowDefinitionConstructionException
Description copied from interface: FlowDefinitionHolder
Refresh the flow definition held by this holder. Calling this method typically triggers flow re-assembly, which may include a refresh from an externalized resource such as a file.

Specified by:
refresh in interface FlowDefinitionHolder
Throws:
FlowDefinitionConstructionException - if there is a problem constructing the target flow definition

destroy

public void destroy()
Description copied from interface: FlowDefinitionHolder
Indicates that the system is being shutdown and any resources flow resources should be released. After this method is called, calls to FlowDefinitionHolder.getFlowDefinition() are undefined. Should only be called once. May be a no-op if the held flow was never constructed to begin with.

Specified by:
destroy in interface FlowDefinitionHolder

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Spring Web Flow