KickJava   Java API By Example, From Geeks To Geeks.

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


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 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 FlowDefinitionHolder {
27
28     /**
29      * The held flow definition.
30      */

31     private final FlowDefinition flowDefinition;
32
33     /**
34      * Creates the static flow definition holder.
35      * @param flowDefinition the flow to hold
36      */

37     public StaticFlowDefinitionHolder(FlowDefinition flowDefinition) {
38         this.flowDefinition = flowDefinition;
39     }
40
41     public String JavaDoc getFlowDefinitionId() {
42         return flowDefinition.getId();
43     }
44
45     public FlowDefinition getFlowDefinition() {
46         return flowDefinition;
47     }
48
49     public void refresh() {
50         // nothing to do
51
}
52 }
Popular Tags