org.springframework.webflow.definition.registry
Class FlowDefinitionRegistryImpl

java.lang.Object
  extended by org.springframework.webflow.definition.registry.FlowDefinitionRegistryImpl
All Implemented Interfaces:
FlowDefinitionLocator, FlowDefinitionRegistry, FlowDefinitionRegistryMBean

public class FlowDefinitionRegistryImpl
extends java.lang.Object
implements FlowDefinitionRegistry

A generic registry implementation for housing one or more flow definitions.

This registry may be refreshed at runtime to "hot reload" refreshable flow definitions. Note that the refresh will only reload already registered flow definitions but will not detect any new flow definitions or remove flow definitions that no longer exist.

Author:
Keith Donald

Constructor Summary
FlowDefinitionRegistryImpl()
           
 
Method Summary
 boolean containsFlowDefinition(java.lang.String id)
          Queries this registry to determine if a specific flow is contained within it.
 FlowDefinition getFlowDefinition(java.lang.String id)
          Lookup the flow definition with the specified id.
 int getFlowDefinitionCount()
          Return the number of flow definitions registered in this registry.
 java.lang.String[] getFlowDefinitionIds()
          Returns the ids of the flow definitions registered in this registry.
 FlowDefinition[] getFlowDefinitions()
          Return all flow definitions registered in this registry.
 void refresh()
          Refresh this flow definition registry, reloading all Flow definitions from their externalized representations.
 void refresh(java.lang.String flowId)
          Refresh the Flow definition in this registry with the id provided, reloading it from it's externalized representation.
 void registerFlowDefinition(FlowDefinitionHolder flowHolder)
          Register a flow definition in this registry.
 void removeFlowDefinition(java.lang.String id)
          Remove identified flow definition from this registry.
 void setParent(FlowDefinitionRegistry parent)
          Sets this registry's parent registry.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FlowDefinitionRegistryImpl

public FlowDefinitionRegistryImpl()
Method Detail

getFlowDefinitionIds

public java.lang.String[] getFlowDefinitionIds()
Description copied from interface: FlowDefinitionRegistryMBean
Returns the ids of the flow definitions registered in this registry.

Specified by:
getFlowDefinitionIds in interface FlowDefinitionRegistryMBean
Returns:
the flow definition ids

getFlowDefinitionCount

public int getFlowDefinitionCount()
Description copied from interface: FlowDefinitionRegistryMBean
Return the number of flow definitions registered in this registry.

Specified by:
getFlowDefinitionCount in interface FlowDefinitionRegistryMBean
Returns:
the flow definition count

containsFlowDefinition

public boolean containsFlowDefinition(java.lang.String id)
Description copied from interface: FlowDefinitionRegistryMBean
Queries this registry to determine if a specific flow is contained within it.

Specified by:
containsFlowDefinition in interface FlowDefinitionRegistryMBean
Parameters:
id - the flow definition id
Returns:
true if a flow definition is contained in this registry with the id provided

refresh

public void refresh()
             throws FlowDefinitionConstructionException
Description copied from interface: FlowDefinitionRegistryMBean
Refresh this flow definition registry, reloading all Flow definitions from their externalized representations.

Specified by:
refresh in interface FlowDefinitionRegistryMBean
Throws:
FlowDefinitionConstructionException

refresh

public void refresh(java.lang.String flowId)
             throws NoSuchFlowDefinitionException,
                    FlowDefinitionConstructionException
Description copied from interface: FlowDefinitionRegistryMBean
Refresh the Flow definition in this registry with the id provided, reloading it from it's externalized representation.

Specified by:
refresh in interface FlowDefinitionRegistryMBean
Parameters:
flowId - the id of the flow definition to refresh
Throws:
NoSuchFlowDefinitionException - if a flow with the id provided is not stored in this registry
FlowDefinitionConstructionException

getFlowDefinition

public FlowDefinition getFlowDefinition(java.lang.String id)
                                 throws NoSuchFlowDefinitionException,
                                        FlowDefinitionConstructionException
Description copied from interface: FlowDefinitionLocator
Lookup the flow definition with the specified id.

Specified by:
getFlowDefinition in interface FlowDefinitionLocator
Parameters:
id - the flow definition id
Returns:
the flow definition
Throws:
NoSuchFlowDefinitionException - when the flow definition with the specified id does not exist
FlowDefinitionConstructionException - if there is a problem constructing the identified flow definition

setParent

public void setParent(FlowDefinitionRegistry parent)
Description copied from interface: FlowDefinitionRegistry
Sets this registry's parent registry. When asked by a client to locate a flow definition this registry will query it's parent if it cannot fullfill the lookup request itself.

Specified by:
setParent in interface FlowDefinitionRegistry
Parameters:
parent - the parent flow definition registry, may be null

getFlowDefinitions

public FlowDefinition[] getFlowDefinitions()
                                    throws FlowDefinitionConstructionException
Description copied from interface: FlowDefinitionRegistry
Return all flow definitions registered in this registry. Note that this will trigger flow assemply for all registered flow definitions (which may be expensive).

Specified by:
getFlowDefinitions in interface FlowDefinitionRegistry
Returns:
the flow definitions
Throws:
FlowDefinitionConstructionException - if there is a problem constructing one of the registered flow definitions

registerFlowDefinition

public void registerFlowDefinition(FlowDefinitionHolder flowHolder)
Description copied from interface: FlowDefinitionRegistry
Register a flow definition in this registry. Registers a "holder", not the Flow definition itself. This allows the actual Flow definition to be loaded lazily only when needed, and also rebuilt at runtime when its underlying resource changes without redeploy.

Specified by:
registerFlowDefinition in interface FlowDefinitionRegistry
Parameters:
flowHolder - a holder holding the flow definition to register

removeFlowDefinition

public void removeFlowDefinition(java.lang.String id)
Remove identified flow definition from this registry. If the given id is not known in this registry, nothing will happen.

Parameters:
id - the flow definition id

toString

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


Copyright © 2004-2007. All Rights Reserved.