KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > webflow > config > WebFlowConfigNamespaceHandler


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.config;
17
18 import org.springframework.beans.factory.xml.BeanDefinitionParser;
19 import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
20
21 /**
22  * <code>NamespaceHandler</code> for the <code>webflow-config</code> namespace.
23  * <p>
24  * Provides {@link BeanDefinitionParser bean definition parsers} for the
25  * <code>&lt;executor&gt;</code> and <code>&lt;registry&gt;</code> tags. An
26  * <code>executor</code> tag can include an <code>execution-listeners</code>
27  * tag and a <code>registry</code> tag can include <code>location</code>
28  * tags.
29  * <p>
30  * Using the <code>executor</code> tag you can configure a
31  * {@link FlowExecutorFactoryBean} that creates a
32  * {@link org.springframework.webflow.executor.FlowExecutor}. The
33  * <code>executor</code> tag allows you to specify the repository type and a
34  * reference to a registry.
35  *
36  * <pre class="code">
37  * &lt;flow:executor id=&quot;registry&quot; registry-ref=&quot;registry&quot; repository-type=&quot;continuation&quot; &gt;
38  * &lt;flow:execution-listeners&gt;
39  * &lt;flow:listener ref=&quot;listener1&quot; /&gt;
40  * &lt;flow:listener ref=&quot;listener2&quot; ref=&quot;*&quot; /&gt;
41  * &lt;flow:listener ref=&quot;listener3&quot; ref=&quot;flow1, flow2, flow3&quot; /&gt;
42  * &lt;flow:execution-listeners /&gt;
43  * &lt;/flow:executor&gt;
44  * </pre>
45  *
46  * <p>
47  * Using the <code>registry</code> tag you can configure an
48  * {@link org.springframework.webflow.engine.builder.xml.XmlFlowRegistryFactoryBean}
49  * to create a registry for use by any number of <code>executor</code>s. The
50  * <code>registry</code> tag supports in-line flow definition locations.
51  *
52  * <pre class="code">
53  * &lt;flow:registry id=&quot;registry&quot;&gt;
54  * &lt;flow:location path=&quot;/path/to/flow.xml&quot; /&gt;
55  * &lt;flow:location path=&quot;/path/with/wildcards/*-flow.xml&quot; /&gt;
56  * &lt;/flow:registry&gt;
57  * </pre>
58  *
59  * @author Ben Hale
60  */

61 public class WebFlowConfigNamespaceHandler extends NamespaceHandlerSupport {
62
63     public void init() {
64         registerBeanDefinitionParser("execution-attributes", new ExecutionAttributesBeanDefinitionParser());
65         registerBeanDefinitionParser("execution-listeners", new ExecutionListenersBeanDefinitionParser());
66         registerBeanDefinitionParser("executor", new ExecutorBeanDefinitionParser());
67         registerBeanDefinitionParser("registry", new RegistryBeanDefinitionParser());
68     }
69 }
Popular Tags