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: import org.springframework.webflow.definition.FlowDefinition;
19:
20: /**
21: * A simple flow definition holder that just holds a constant singleton
22: * reference to a flow definition.
23: *
24: * @author Keith Donald
25: */
26: public final class StaticFlowDefinitionHolder implements
27: FlowDefinitionHolder {
28:
29: /**
30: * The held flow definition.
31: */
32: private final FlowDefinition flowDefinition;
33:
34: /**
35: * Creates the static flow definition holder.
36: * @param flowDefinition the flow to hold
37: */
38: public StaticFlowDefinitionHolder(FlowDefinition flowDefinition) {
39: this .flowDefinition = flowDefinition;
40: }
41:
42: public String getFlowDefinitionId() {
43: return flowDefinition.getId();
44: }
45:
46: public FlowDefinition getFlowDefinition() {
47: return flowDefinition;
48: }
49:
50: public void refresh() {
51: // nothing to do
52: }
53: }
|