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 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() throws FlowDefinitionConstructionException; 45 46 /** 47 * Refresh the flow definition held by this holder. Calling this method 48 * typically triggers flow reassembly, which may include a refresh from an 49 * externalized resource such as a file. 50 * @throws FlowDefinitionConstructionException if there is a problem constructing 51 * the target flow definition 52 */ 53 public void refresh() throws FlowDefinitionConstructionException; 54 }