01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05: package org.jasig.portal.lang;
06:
07: /**
08: * The <code>ThrowableHandler</code> interface defines the error
09: * management mechanism for handler implementations. Error management
10: * implementations may process the reported error in any way necessary
11: * but the implementations should not throw any exceptions from this
12: * method. By definition, invocation of the <code>handle</code> method
13: * means that the error condition is handled by the
14: * implementation.<p/>
15: *
16: * If an error condition should be wrapped and a new exception thrown,
17: * the calling code should not use the
18: * <code>ThrowableHelper.handle</code> methods to "handle" the
19: * error. Instead, the code should create the new error object with
20: * the triggering error object captured as its "cause"; see the
21: * <code>ThrowableHelper</code> for details.
22: *
23: * @author <a href="mailto:jnielsen@sct.com">Jan Nielsen</a>
24: *
25: * @version "$Revision: 34760 $"
26: **/
27: public interface ThrowableHandler {
28:
29: /**
30: * Handles the error condition specified in the parameters. The
31: * handler can use the client class to resolve the error message
32: * property name, and generate a localized message from the
33: * optional objects. Implementations should not throw any errors
34: * from this method, except <code>NullPointerException</code> if
35: * the client or error message property name is <code>null</code>.
36: *
37: * @param client client calling the handle method
38: * @param property property name associated with error message
39: * @param objects objects associated with the error message, or
40: * <code>null</code>
41: * @param cause throwable condition which caused the error, or
42: * <code>null</code>
43: * @throws NullPointerException if client or property is
44: * <code>null</code>
45: **/
46: void handle(Class client, String property, String[] objects,
47: Throwable cause);
48: }
|