01: /*
02: * Copyright 2004-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.springframework.webflow.definition.registry;
17:
18: /**
19: * A management interface for managing flow definition registries at runtime.
20: * Provides the ability to query the size and state of the registry, as well as
21: * refresh registered flow definitions at runtime.
22: * <p>
23: * Flow registries that implement this interface may be exposed for management
24: * over the JMX protocol. The following is an example of using Spring's JMX
25: * <code>MBeanExporter</code> to export a flow registry to an MBeanServer:
26: * <pre class="code">
27: * <!-- Creates the registry of flow definitions for this application -->
28: * <bean name="flowRegistry" class="org.springframework.webflow...XmlFlowRegistryFactoryBean">
29: * <property name="locations" value="/WEB-INF/flow1.xml"/>
30: * </bean>
31: *
32: * <!-- Automatically exports the created flowRegistry as an MBean -->
33: * <bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter">
34: * <property name="beans">
35: * <map>
36: * <entry key="spring-webflow:name=flowRegistry" value-ref="flowRegistry"/>
37: * </map>
38: * </property>
39: * <property name="assembler">
40: * <bean class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler">
41: * <property name="managedInterfaces"
42: * value="org.springframework.webflow.definition.registry.FlowDefinitionRegistryMBean"/>
43: * </bean>
44: * </property>
45: * </bean>
46: * </pre>
47: * With the above configuration, you may then use any JMX client (such as Sun's
48: * jConsole which ships with JDK 1.5) to refresh flow definitions at runtime.
49: *
50: * @author Keith Donald
51: */
52: public interface FlowDefinitionRegistryMBean {
53:
54: /**
55: * Returns the ids of the flow definitions registered in this registry.
56: * @return the flow definition ids
57: */
58: public String[] getFlowDefinitionIds();
59:
60: /**
61: * Return the number of flow definitions registered in this registry.
62: * @return the flow definition count
63: */
64: public int getFlowDefinitionCount();
65:
66: /**
67: * Queries this registry to determine if a specific flow is contained within
68: * it.
69: * @param id the flow definition id
70: * @return true if a flow definition is contained in this registry with the
71: * id provided
72: */
73: public boolean containsFlowDefinition(String id);
74:
75: /**
76: * Refresh this flow definition registry, reloading all Flow definitions
77: * from their externalized representations.
78: */
79: public void refresh() throws FlowDefinitionConstructionException;
80:
81: /**
82: * Refresh the Flow definition in this registry with the <code>id</code>
83: * provided, reloading it from it's externalized representation.
84: * @param flowDefinitionId the id of the flow definition to refresh
85: * @throws NoSuchFlowDefinitionException if a flow with the id provided is not
86: * stored in this registry
87: */
88: public void refresh(String flowDefinitionId)
89: throws NoSuchFlowDefinitionException,
90: FlowDefinitionConstructionException;
91:
92: }
|