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.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><executor></code> and <code><registry></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: * <flow:executor id="registry" registry-ref="registry" repository-type="continuation" >
38: * <flow:execution-listeners>
39: * <flow:listener ref="listener1" />
40: * <flow:listener ref="listener2" ref="*" />
41: * <flow:listener ref="listener3" ref="flow1, flow2, flow3" />
42: * <flow:execution-listeners />
43: * </flow:executor>
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: * <flow:registry id="registry">
54: * <flow:location path="/path/to/flow.xml" />
55: * <flow:location path="/path/with/wildcards/*-flow.xml" />
56: * </flow:registry>
57: * </pre>
58: *
59: * @author Ben Hale
60: */
61: public class WebFlowConfigNamespaceHandler extends
62: NamespaceHandlerSupport {
63:
64: public void init() {
65: registerBeanDefinitionParser("execution-attributes",
66: new ExecutionAttributesBeanDefinitionParser());
67: registerBeanDefinitionParser("execution-listeners",
68: new ExecutionListenersBeanDefinitionParser());
69: registerBeanDefinitionParser("executor",
70: new ExecutorBeanDefinitionParser());
71: registerBeanDefinitionParser("registry",
72: new RegistryBeanDefinitionParser());
73: }
74: }
|