Novell exteNd
Director 5.2 API

com.sssw.fw.util
Class EboExceptionHelper

java.lang.Object
 |
 +--com.sssw.fw.util.EboExceptionHelper

public class EboExceptionHelper
extends Object

This class contains helper methods that are related to exceptions and exception handling.


Constructor Summary
EboExceptionHelper()
           
 
Method Summary
static Throwable getOriginalThrowable(Throwable th)
          Returns the original exception from a stack of parented exceptions
static void handleException(Exception ex, EbiLog log, boolean printStackTrace, boolean rethrowAsRuntime)
          Handle an exception.
static void handleException(Exception ex, EbiLog log, boolean printStackTrace, boolean rethrowAsRuntime, String message)
          Handle an exception.
static void handleException2(Exception ex, EbiLog log, boolean printStackTrace, boolean rethrow)
          Handle an exception.
static void handleException2(Exception ex, EbiLog log, boolean printStackTrace, boolean rethrow, String message)
          Handle an exception.
static void handleException3(Exception ex, EbiLog log, boolean printStackTrace, boolean rethrow)
          Handle an exception.
static void handleException3(Exception ex, EbiLog log, boolean printStackTrace, boolean rethrow, String message)
          Handle an exception.
static void handleException4(Exception ex, EbiLog log, boolean printStackTrace, boolean rethrow)
          Handle an exception.
static void handleException4(Exception ex, EbiLog log, boolean printStackTrace, boolean rethrow, String message)
          Handle an exception.
static void handleThrowable(Throwable throwable, EbiLog log, boolean printStackTrace, boolean rethrowAsRuntime)
          Handle an Throwable object.
static void handleThrowable2(Throwable throwable, EbiLog log, boolean printStackTrace, boolean rethrowAsThrowable)
          Handle an Throwable object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EboExceptionHelper

public EboExceptionHelper()
Method Detail

handleThrowable

public static void handleThrowable(Throwable throwable,
                                   EbiLog log,
                                   boolean printStackTrace,
                                   boolean rethrowAsRuntime)
Handle an Throwable object.
Parameters:
throwable - the Throwable to handle

handleThrowable2

public static void handleThrowable2(Throwable throwable,
                                    EbiLog log,
                                    boolean printStackTrace,
                                    boolean rethrowAsThrowable)
                             throws Throwable
Handle an Throwable object.
Parameters:
throwable - the Throwable to handle
log - the log to log the exception to; if null is passed in, the exception is not logged
printStackTrace - if true, print the exception stack trace onto the console
rethrowAstHROWABLE - if true, the passed in throwable will be rethrown as itself

handleException

public static void handleException(Exception ex,
                                   EbiLog log,
                                   boolean printStackTrace,
                                   boolean rethrowAsRuntime)
Handle an exception.
Parameters:
ex - the exception to handle
log - the log to log the exception to; if null is passed in, the exception is not logged
printStackTrace - if true, print the exception stack trace onto the console
rethrowAsRuntime - if true, the passed in exception will get wrapped into an EboRuntimeException and rethrown, unless it is already a RuntimeException or subclass thereof

handleException2

public static void handleException2(Exception ex,
                                    EbiLog log,
                                    boolean printStackTrace,
                                    boolean rethrow)
                             throws EboUnrecoverableSystemException
Handle an exception.
Parameters:
ex - the exception to handle
log - the log to log the exception to; if null is passed in, the exception is not logged
printStackTrace - if true, print the exception stack trace onto the console
rethrow - if true, rethrow the exception

handleException3

public static void handleException3(Exception ex,
                                    EbiLog log,
                                    boolean printStackTrace,
                                    boolean rethrow)
                             throws EboUnrecoverableSystemException,
                                    EboSecurityException
Handle an exception.
Parameters:
ex - the exception to handle
log - the log to log the exception to; if null is passed in, the exception is not logged
printStackTrace - if true, print the exception stack trace onto the console
rethrow - if true, rethrow the exception

handleException4

public static void handleException4(Exception ex,
                                    EbiLog log,
                                    boolean printStackTrace,
                                    boolean rethrow)
                             throws EboUnrecoverableSystemException,
                                    EboSecurityException,
                                    EboItemExistenceException
Handle an exception.
Parameters:
ex - the exception to handle
log - the log to log the exception to; if null is passed in, the exception is not logged
printStackTrace - if true, print the exception stack trace onto the console
rethrow - if true, rethrow the exception

handleException

public static void handleException(Exception ex,
                                   EbiLog log,
                                   boolean printStackTrace,
                                   boolean rethrowAsRuntime,
                                   String message)
Handle an exception.
Parameters:
ex - the exception to handle
log - the log to log the exception to; if null is passed in, the exception is not logged
printStackTrace - if true, print the exception stack trace onto the console
rethrowAsRuntime - if true, the passed in exception will get wrapped into an EboRuntimeException and rethrown, unless it is already a RuntimeException or subclass thereof
message - an extra message to log, prior to the stack trace; this message is used in the top-level RuntimeException which wraps the passed-in Exception

handleException2

public static void handleException2(Exception ex,
                                    EbiLog log,
                                    boolean printStackTrace,
                                    boolean rethrow,
                                    String message)
                             throws EboUnrecoverableSystemException
Handle an exception.
Parameters:
ex - the exception to handle
log - the log to log the exception to; if null is passed in, the exception is not logged
printStackTrace - if true, print the exception stack trace onto the console
rethrow - if true, rethrow the exception
message - an extra message to log, prior to the stack trace; this message is used in the top-level EboUnrecoverableSystemException which wraps the passed-in Exception, unless it already is an instance of EboUnrecoverableSystemException or RuntimeException

handleException3

public static void handleException3(Exception ex,
                                    EbiLog log,
                                    boolean printStackTrace,
                                    boolean rethrow,
                                    String message)
                             throws EboUnrecoverableSystemException,
                                    EboSecurityException
Handle an exception.
Parameters:
ex - the exception to handle
log - the log to log the exception to; if null is passed in, the exception is not logged
printStackTrace - if true, print the exception stack trace onto the console
rethrow - if true, rethrow the exception
message - an extra message to log, prior to the stack trace; this message is used in the top-level EboUnrecoverableSystemException which wraps the passed-in Exception, unless it is already an instance of EboUnrecoverableSystemException, EboSecurityException, or RuntimeException

handleException4

public static void handleException4(Exception ex,
                                    EbiLog log,
                                    boolean printStackTrace,
                                    boolean rethrow,
                                    String message)
                             throws EboUnrecoverableSystemException,
                                    EboSecurityException,
                                    EboItemExistenceException
Handle an exception.
Parameters:
ex - the exception to handle
log - the log to log the exception to; if null is passed in, the exception is not logged
printStackTrace - if true, print the exception stack trace onto the console
rethrow - if true, rethrow the exception
message - an extra message to log, prior to the stack trace; this message is used in the top-level RuntimeException which wraps the passed-in Exception

getOriginalThrowable

public static Throwable getOriginalThrowable(Throwable th)
Returns the original exception from a stack of parented exceptions
Parameters:
th - the throwable to be interrogated
Returns:
the throwable that was originally thrown

Novell exteNd
Director 5.2 API