src/core/net/sf/basedb/util/extensions/ErrorHandlerFactory.java

Code
Comments
Other
Rev Date Author Line
5486 12 Nov 10 nicklas 1 /**
5486 12 Nov 10 nicklas 2   $Id$
5486 12 Nov 10 nicklas 3
5486 12 Nov 10 nicklas 4   Copyright (C) 2010 Nicklas Nordborg
5486 12 Nov 10 nicklas 5
5486 12 Nov 10 nicklas 6   This file is part of BASE - BioArray Software Environment.
5486 12 Nov 10 nicklas 7   Available at http://base.thep.lu.se/
5486 12 Nov 10 nicklas 8
5486 12 Nov 10 nicklas 9   BASE is free software; you can redistribute it and/or
5486 12 Nov 10 nicklas 10   modify it under the terms of the GNU General Public License
5486 12 Nov 10 nicklas 11   as published by the Free Software Foundation; either version 3
5486 12 Nov 10 nicklas 12   of the License, or (at your option) any later version.
5486 12 Nov 10 nicklas 13
5486 12 Nov 10 nicklas 14   BASE is distributed in the hope that it will be useful,
5486 12 Nov 10 nicklas 15   but WITHOUT ANY WARRANTY; without even the implied warranty of
5486 12 Nov 10 nicklas 16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5486 12 Nov 10 nicklas 17   GNU General Public License for more details.
5486 12 Nov 10 nicklas 18
5486 12 Nov 10 nicklas 19   You should have received a copy of the GNU General Public License
5486 12 Nov 10 nicklas 20   along with BASE. If not, see <http://www.gnu.org/licenses/>.
5486 12 Nov 10 nicklas 21 */
5486 12 Nov 10 nicklas 22 package net.sf.basedb.util.extensions;
5486 12 Nov 10 nicklas 23
5486 12 Nov 10 nicklas 24 /**
5486 12 Nov 10 nicklas 25   Error handler factories are responsible for creating error handlers.
5486 12 Nov 10 nicklas 26   Each extension point may provide a specific factory implementation
5486 12 Nov 10 nicklas 27   (see {@link ExtensionPoint#getErrorHandlerFactory()}). If no factory
5486 12 Nov 10 nicklas 28   is given, a default error handler will be used by the system
5486 12 Nov 10 nicklas 29   (eg. {@link LoggingErrorHandlerFactory}). The error handler factory
5486 12 Nov 10 nicklas 30   must be thread-safe since it can be used by many threads at the same
5486 12 Nov 10 nicklas 31   time.
5486 12 Nov 10 nicklas 32
5486 12 Nov 10 nicklas 33   @author Nicklas
5486 12 Nov 10 nicklas 34   @since 2.17
5486 12 Nov 10 nicklas 35   @base.modified $Date$
5486 12 Nov 10 nicklas 36 */
5486 12 Nov 10 nicklas 37 public interface ErrorHandlerFactory<A extends Action>
5486 12 Nov 10 nicklas 38 {
5486 12 Nov 10 nicklas 39
5486 12 Nov 10 nicklas 40   /**
5486 12 Nov 10 nicklas 41     Get an error handler for the current context. This method is called
5486 12 Nov 10 nicklas 42     once for each request/use of an extension point. Errors that happen
5486 12 Nov 10 nicklas 43     when processing things related to this extension point will be
5486 12 Nov 10 nicklas 44     directed to the error handler returned by this method. The factory
5486 12 Nov 10 nicklas 45     may create a new or it may re-use the same error handler for each 
5486 12 Nov 10 nicklas 46     request. If the error handler is re-used it must be thread-safe.
5486 12 Nov 10 nicklas 47     
5486 12 Nov 10 nicklas 48     @param context The current invokation context which is an extension
5486 12 Nov 10 nicklas 49       point context (the {@link InvokationContext#getExtension()} method
5486 12 Nov 10 nicklas 50       is expected to return null)
5486 12 Nov 10 nicklas 51   */
5486 12 Nov 10 nicklas 52   public ErrorHandler<A> getErrorHandler(InvokationContext<? extends A> context);
5486 12 Nov 10 nicklas 53   
5486 12 Nov 10 nicklas 54 }