SOAj Core v. 1.3


info.soaj.core.util.internal
Class SjUtilThrowable

java.lang.Object
  extended by info.soaj.core.util.internal.SjUtilThrowable

public class SjUtilThrowable
extends java.lang.Object

This utility class contains static methods for handling throwables.

Copyright (c) 2006 - 2009 by Global Technology Consulting Group, Inc. at gtcGroup.com .

Since:
v. 1.0
Author:
MarvinToll@gtcGroup.com

Field Summary
private static java.lang.String CLASS_NAME
          Class name.
 
Constructor Summary
private SjUtilThrowable()
          Constructor - Private
 
Method Summary
private static void emailException(SjBaseCoreRuntimeException baseRuntimeException, SjAbstractPluginEmail emailPlugin)
           
private static void formulateStackTrace(SjBaseCoreRuntimeException baseRuntimeException)
          This method formulates a stack trace if necessary and sets it in the exception.
private static void logException(SjBaseCoreRuntimeException baseRuntimeException, SjAbstractPluginLogging loggingPlugin)
           
static void logExceptionOccuredWhileThrowingException(java.lang.String ClassName, java.lang.String MethodName, java.lang.RuntimeException e)
          Logging statement providing context for the reader of the log.
private static void logOut(SjBaseCoreRuntimeException baseRuntimeException, SjAbstractPluginLogging logThrowablePlugin, SjAbstractPluginEmail emailPlugin)
          This method unwraps the throwable to determine what should be logged and/or emailed.
static void logThrowable(SjBaseCoreRuntimeException baseRuntimeException)
          This method processes both self-logging and self-emailing without requiring either plugin as an argument.
static void logThrowable(SjBaseCoreRuntimeException baseRuntimeException, SjAbstractPluginLogging logThrowablePlugin)
          This overloaded method processes both self-logging and self-emailing while requiring the logging plugin as an argument, or null.
static void logThrowable(SjBaseCoreRuntimeException baseRuntimeException, SjAbstractPluginLogging logThrowablePlugin, SjAbstractPluginEmail emailPlugin)
          This overloaded method processes both self-logging and self-emailing while requiring the logging and email plugins as an argument, or null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

private static final java.lang.String CLASS_NAME
Class name.

Constructor Detail

SjUtilThrowable

private SjUtilThrowable()
Constructor - Private

Method Detail

logThrowable

public static void logThrowable(SjBaseCoreRuntimeException baseRuntimeException)
This method processes both self-logging and self-emailing without requiring either plugin as an argument.

Parameters:
baseRuntimeException -

logThrowable

public static void logThrowable(SjBaseCoreRuntimeException baseRuntimeException,
                                SjAbstractPluginLogging logThrowablePlugin)
This overloaded method processes both self-logging and self-emailing while requiring the logging plugin as an argument, or null.

Parameters:
baseRuntimeException -
logThrowablePlugin - Or null.

logThrowable

public static void logThrowable(SjBaseCoreRuntimeException baseRuntimeException,
                                SjAbstractPluginLogging logThrowablePlugin,
                                SjAbstractPluginEmail emailPlugin)
This overloaded method processes both self-logging and self-emailing while requiring the logging and email plugins as an argument, or null. It may be entered recursively (typically for processing nested exceptions).

Parameters:
baseRuntimeException -
logThrowablePlugin - Or null.
emailPlugin - Or null.

logExceptionOccuredWhileThrowingException

public static void logExceptionOccuredWhileThrowingException(java.lang.String ClassName,
                                                             java.lang.String MethodName,
                                                             java.lang.RuntimeException e)
Logging statement providing context for the reader of the log. This method is invoked when an exception occurs while throwing an exception! Note: THE EXCEPTION IS RETHROWN.

Parameters:
ClassName -
MethodName -
e -

logOut

private static void logOut(SjBaseCoreRuntimeException baseRuntimeException,
                           SjAbstractPluginLogging logThrowablePlugin,
                           SjAbstractPluginEmail emailPlugin)
This method unwraps the throwable to determine what should be logged and/or emailed.

Parameters:
baseRuntimeException -
logThrowablePlugin - Or null.
emailPlugin - Or null.

logException

private static void logException(SjBaseCoreRuntimeException baseRuntimeException,
                                 SjAbstractPluginLogging loggingPlugin)
Parameters:
baseRuntimeException -
loggingPlugin -

emailException

private static void emailException(SjBaseCoreRuntimeException baseRuntimeException,
                                   SjAbstractPluginEmail emailPlugin)
Parameters:
baseRuntimeException -
emailPlugin -

formulateStackTrace

private static void formulateStackTrace(SjBaseCoreRuntimeException baseRuntimeException)
This method formulates a stack trace if necessary and sets it in the exception.

Parameters:
baseRuntimeException -

SOAj Core v. 1.3


Copyright (c) 2006 - 2009 by Global Technology Consulting Group, Inc. at gtcGroup.com.
Use is authorized, provided the source is acknowledged by inclusion of this copyright notice.