001/* 002 * jDTAUS Core SPI 003 * Copyright (C) 2005 Christian Schulte 004 * <cs@schulte.it> 005 * 006 * This library is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 2.1 of the License, or any later version. 010 * 011 * This library is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public 017 * License along with this library; if not, write to the Free Software 018 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 019 * 020 */ 021package org.jdtaus.core.lang.spi; 022 023import org.jdtaus.core.lang.ExceptionEvent; 024import org.jdtaus.core.lang.ExceptionEventSource; 025 026/** 027 * Handles exceptions. 028 * <p>jDTAUS Core SPI {@code ExceptionHandler} specification to be used by 029 * implementations to handle exceptions.</p> 030 * 031 * @author <a href="mailto:cs@schulte.it">Christian Schulte</a> 032 * @version $JDTAUS: ExceptionHandler.java 8641 2012-09-27 06:45:17Z schulte $ 033 */ 034public interface ExceptionHandler extends ExceptionEventSource 035{ 036 //--ExceptionHandler-------------------------------------------------------- 037 038 /** 039 * Gets all {@code ExceptionEvent}s handled by the handler. 040 * 041 * @return an array of all {@code ExceptionEvent}s handled by the handler. 042 * @deprecated Starting with version 1.8, the {@code ExceptionListener}s 043 * provided to a system should be used to gather information about handled 044 * exceptions. 045 */ 046 ExceptionEvent[] getExceptionEvents(); 047 048 /** 049 * Handles a given exception. 050 * 051 * @param t the {@code Throwable} that was caught. 052 * 053 * @throws NullPointerException if {@code t} is {@code null}. 054 */ 055 void handle( Throwable t ); 056 057 //--------------------------------------------------------ExceptionHandler-- 058}