com.jmo.mailmessager.utils
Class ExceptionHandler

java.lang.Object
  extended by com.jmo.mailmessager.utils.ExceptionHandler

public abstract class ExceptionHandler
extends java.lang.Object

Abstract class containing static methods to log timestamp of exception's occurence and its stack trace. Also controls showing Tray Icon balloon messages.

Version:
0.0.1
Author:
John Morales
See Also:
MailMessagerConstants, MailMessagerStatusBar, MailMessagerTray

Constructor Summary
ExceptionHandler()
           
 
Method Summary
static void logException(java.lang.Exception e)
          Logs timestamp and stack trace.
static void logException(java.lang.Exception e, boolean closeStatusBar, boolean showBalloon)
          Logs timestamp and stack trace.
static void logException(java.lang.Exception e, boolean closeStatusBar, boolean showBalloon, boolean exit, long delay)
          Logs timestamp and stack trace.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHandler

public ExceptionHandler()
Method Detail

logException

public static void logException(java.lang.Exception e)
Logs timestamp and stack trace. Does NOT close status bar, show balloon message, exit application, nor cause thread to sleep.

Parameters:
e - Caught Exception

logException

public static void logException(java.lang.Exception e,
                                boolean closeStatusBar,
                                boolean showBalloon)
Logs timestamp and stack trace. Closes the status bar according to closeStatusBar. Shows balloon message according to showBalloon. Does NOT exit application nor cause thread to sleep.

Parameters:
e - Caught Exception
closeStatusBar - True to close Status Bar, false otherwise
showBalloon - True to show the balloon message, false otherwise

logException

public static void logException(java.lang.Exception e,
                                boolean closeStatusBar,
                                boolean showBalloon,
                                boolean exit,
                                long delay)
Logs timestamp and stack trace. Closes the status bar according to closeStatusBar. Shows balloon message according to showBalloon. Exits the application according to exit. Causes the current thread to sleep delay number of milliseconds.

Parameters:
e - Caught Exception
closeStatusBar - True to close Status Bar, false otherwise
showBalloon - True to show the balloon message, false otherwise
exit - True to exit the application, false otherwise
delay - Time in milliseconds to have thread sleep