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 package org.apache.excalibur.event.command; 18 19 /** 20 * NullCommandFailureHandler is used to do nothing if a command fails. 21 * 22 * @author <a HREF="mailto:dev@avalon.apache.org">Avalon Development Team</a> 23 * @version CVS $ Revision: 1.1 $ 24 */ 25 public class NullCommandFailureHandler implements CommandFailureHandler 26 { 27 public static final NullCommandFailureHandler SHARED_INSTANCE = new NullCommandFailureHandler(); 28 /** 29 * Handle a command failure. If a command throws an exception, it has failed. The 30 * CommandManager will call this method so that we can handle the problem effectively. 31 * This implementation does nothing and always returns <code>false</code>. 32 * 33 * @param command The original Command object that failed 34 * @param throwable The throwable that caused the failure 35 * @return <code>true</code> if the CommandManager should cease to process commands. 36 */ 37 public boolean handleCommandFailure( Command command, Throwable throwable ) 38 { 39 return false; 40 } 41 } 42