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.engine.builder.xml;
17:
18: import org.springframework.beans.factory.BeanFactory;
19: import org.springframework.webflow.engine.Flow;
20:
21: /**
22: * Simple object that holds a reference to a local bean factory housing services needed by a flow definition
23: * at execution time.
24: * <p>
25: * Internal helper class of the {@link org.springframework.webflow.engine.builder.xml.XmlFlowBuilder}. Package private
26: * to highlight it's non-public nature.
27: *
28: * @see org.springframework.webflow.engine.builder.xml.XmlFlowBuilder
29: * @see org.springframework.webflow.engine.builder.xml.LocalFlowServiceLocator
30: *
31: * @author Keith Donald
32: */
33: class LocalFlowServiceRegistry {
34:
35: /**
36: * The flow this registry is for (and scoped by).
37: */
38: private Flow flow;
39:
40: /**
41: * The local registry holding the artifacts local to the flow.
42: */
43: private BeanFactory beanFactory;
44:
45: /**
46: * Create a new local service registry.
47: * @param flow the flow this registry is for (and scoped by)
48: * @param beanFactory the actual backing registry - a Spring bean factory
49: */
50: public LocalFlowServiceRegistry(Flow flow, BeanFactory beanFactory) {
51: this .flow = flow;
52: this .beanFactory = beanFactory;
53: }
54:
55: /**
56: * Returns the flow this registry is for (and scoped by).
57: */
58: public Flow getFlow() {
59: return flow;
60: }
61:
62: /**
63: * Returns the bean factory acting as the physical registry.
64: */
65: public BeanFactory getBeanFactory() {
66: return beanFactory;
67: }
68: }
|