1 /* 2 * Copyright 1999-2004 The Apache Software Foundation 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 12 * implied. 13 * 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package org.apache.excalibur.event.command; 19 20 /** 21 * CommandFailureHandler is used by the CommandManager to handle any exceptions that might 22 * be thrown by a Command. That way the application using the CommandManager can properly 23 * manage what happens when an exception is thrown. 24 * 25 * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a> 26 * @version CVS Revision: 1.1 $ 27 */ 28 public interface CommandFailureHandler 29 { 30 /** 31 * Handle a command failure. If a command throws an exception, it has failed. The 32 * CommandManager will call this method so that we can handle the problem effectively. 33 * 34 * @param command The original Command object that failed 35 * @param throwable The throwable that caused the failure 36 * @return <code>true</code> if the CommandManager should cease to process commands. 37 */ 38 boolean handleCommandFailure(final Command command, final Throwable throwable); 39 } 40