KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > webflow > definition > registry > FlowDefinitionRegistryMBean


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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  * &lt;!-- Creates the registry of flow definitions for this application --&gt;
28  * &lt;bean name=&quot;flowRegistry&quot; class=&quot;org.springframework.webflow...XmlFlowRegistryFactoryBean&quot;&gt;
29  * &lt;property name=&quot;locations&quot; value=&quot;/WEB-INF/flow1.xml&quot;/&gt;
30  * &lt;/bean&gt;
31  *
32  * &lt;!-- Automatically exports the created flowRegistry as an MBean --&gt;
33  * &lt;bean id=&quot;mbeanExporter&quot; class=&quot;org.springframework.jmx.export.MBeanExporter&quot;&gt;
34  * &lt;property name=&quot;beans&quot;&gt;
35  * &lt;map&gt;
36  * &lt;entry key=&quot;spring-webflow:name=flowRegistry&quot; value-ref=&quot;flowRegistry&quot;/&gt;
37  * &lt;/map&gt;
38  * &lt;/property&gt;
39  * &lt;property name=&quot;assembler&quot;&gt;
40  * &lt;bean class=&quot;org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler&quot;&gt;
41  * &lt;property name=&quot;managedInterfaces&quot; value=&quot;org.springframework.webflow.definition.registry.FlowDefinitionRegistryMBean&quot;/&gt;
42  * &lt;/bean&gt;
43  * &lt;/property&gt;
44  * &lt;/bean&gt;
45  * </pre>
46  * With the above configuration, you may then use any JMX client (such as Sun's
47  * jConsole which ships with JDK 1.5) to refresh flow definitions at runtime.
48  *
49  * @author Keith Donald
50  */

51 public interface FlowDefinitionRegistryMBean {
52
53     /**
54      * Returns the ids of the flow definitions registered in this registry.
55      * @return the flow definition ids
56      */

57     public String JavaDoc[] getFlowDefinitionIds();
58
59     /**
60      * Return the number of flow definitions registered in this registry.
61      * @return the flow definition count
62      */

63     public int getFlowDefinitionCount();
64
65     /**
66      * Queries this registry to determine if a specific flow is contained within
67      * it.
68      * @param id the flow definition id
69      * @return true if a flow definition is contained in this registry with the
70      * id provided
71      */

72     public boolean containsFlowDefinition(String JavaDoc id);
73
74     /**
75      * Refresh this flow definition registry, reloading all Flow definitions
76      * from their externalized representations.
77      */

78     public void refresh() throws FlowDefinitionConstructionException;
79
80     /**
81      * Refresh the Flow definition in this registry with the <code>id</code>
82      * provided, reloading it from it's externalized representation
83      * @param flowDefinitionId the id of the flow definition to refresh
84      * @throws NoSuchFlowDefinitionException if a flow with the id provided is not
85      * stored in this registry
86      */

87     public void refresh(String JavaDoc flowDefinitionId)
88             throws NoSuchFlowDefinitionException, FlowDefinitionConstructionException;
89
90 }
Popular Tags