1 /***************************************************************************** 2 * Copyright (C) Zephyr Business Solution. All rights reserved. * 3 * ------------------------------------------------------------------------- * 4 * The software in this package is published under the terms of the BSD * 5 * style license a copy of which has been included with this distribution in * 6 * the LICENSE.txt file. * 7 *****************************************************************************/ 8 9 /* 10 * Created on Apr 9, 2005 11 * 12 * Author Ben Yu 13 * ZBS 14 */ 15 package jfun.yan; 16 17 /** 18 * This interface represents an error recovery strategy. 19 * 20 * {@link Monad#recover(Creator,Recovery)} and {@link Component#recover(Recovery)} 21 * use this interface to recover from an error. 22 * <p> 23 * Zephyr Business Solution 24 * 25 * @author Ben Yu 26 * 27 */ 28 public interface Recovery<T> extends java.io.Serializable{ 29 /** 30 * recover from an error. 31 * The implementation can choose to return an alternative Creator object 32 * or re-throw the exception. 33 * @param e the exception. 34 * @return the alternative Creator object. 35 */ 36 Creator<T> recover(RuntimeException e); 37 } 38