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.engine; 17 18 import org.springframework.webflow.execution.FlowExecutionException; 19 import org.springframework.webflow.execution.ViewSelection; 20 21 /** 22 * A strategy for handling an exception that occurs at runtime during the 23 * execution of a flow definition. 24 * 25 * @author Keith Donald 26 */ 27 public interface FlowExecutionExceptionHandler { 28 29 /** 30 * Can this handler handle the given exception? 31 * @param exception the exception that occured 32 * @return true if yes, false if no 33 */ 34 public boolean handles(FlowExecutionException exception); 35 36 /** 37 * Handle the exception in the context of the current request, optionally 38 * making an error view selection that should be rendered. 39 * @param exception the exception that occured 40 * @param context the execution control context for this request 41 * @return the selected error view that should be displayed (may be null if 42 * the handler chooses not to select a view, in which case other exception 43 * handlers may be given a chance to handle the exception) 44 */ 45 public ViewSelection handle(FlowExecutionException exception, RequestControlContext context); 46 } 47