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 holder holding a reference to a Flow definition. Provides a layer of
22: * indirection, enabling things like "hot-reloadable" flow definitions.
23: *
24: * @see FlowDefinitionRegistry#registerFlowDefinition(FlowDefinitionHolder)
25: *
26: * @author Keith Donald
27: */
28: public interface FlowDefinitionHolder {
29:
30: /**
31: * Returns the <code>id</code> of the flow definition held by this holder.
32: * This is a <i>lightweight</i> method callers may call to obtain the id of
33: * the flow without triggering full flow definition assembly (which may be
34: * an expensive operation).
35: */
36: public String getFlowDefinitionId();
37:
38: /**
39: * Returns the flow definition held by this holder. Calling this method the
40: * first time may trigger flow assembly (which may be expensive).
41: * @throws FlowDefinitionConstructionException if there is a problem constructing
42: * the target flow definition
43: */
44: public FlowDefinition getFlowDefinition()
45: throws FlowDefinitionConstructionException;
46:
47: /**
48: * Refresh the flow definition held by this holder. Calling this method
49: * typically triggers flow reassembly, which may include a refresh from an
50: * externalized resource such as a file.
51: * @throws FlowDefinitionConstructionException if there is a problem constructing
52: * the target flow definition
53: */
54: public void refresh() throws FlowDefinitionConstructionException;
55: }
|