jfun.yan.lifecycle
Class ExceptionHandlers

java.lang.Object
  extended by jfun.yan.lifecycle.ExceptionHandlers

public class ExceptionHandlers
extends java.lang.Object

Facade class to provide some basic ExceptionHandler implementations.

Codehaus.org.

Author:
Michelle Lei

Constructor Summary
ExceptionHandlers()
           
 
Method Summary
static ExceptionHandler printer()
          Get an ExceptionHandler object that prints the stack trace to System.err.
static ExceptionHandler printer(java.io.PrintStream out)
          Get an ExceptionHandler object that prints the stack trace to a PrintStream object.
static ExceptionHandler suppresser()
          Get an ExceptionHandler object that silently ignores any exception thrown out of the action.
static ExceptionHandler thrower()
          Get an ExceptionHandler object that re-throw the exception.
static ExceptionHandler writer(java.io.PrintWriter out)
          Get an ExceptionHandler object that prints the stack trace to a PrintWriter object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHandlers

public ExceptionHandlers()
Method Detail

printer

public static ExceptionHandler printer()
Get an ExceptionHandler object that prints the stack trace to System.err.

Returns:
the ExceptionHandler object.

printer

public static ExceptionHandler printer(java.io.PrintStream out)
Get an ExceptionHandler object that prints the stack trace to a PrintStream object.

Returns:
the ExceptionHandler object.

writer

public static ExceptionHandler writer(java.io.PrintWriter out)
Get an ExceptionHandler object that prints the stack trace to a PrintWriter object.

Returns:
the ExceptionHandler object.

suppresser

public static ExceptionHandler suppresser()
Get an ExceptionHandler object that silently ignores any exception thrown out of the action.

Returns:
the ExceptionHandler object.

thrower

public static ExceptionHandler thrower()
Get an ExceptionHandler object that re-throw the exception. If the exception is a checked exception, it is wrapped up in the InvocationException object and thrown out.

Returns:
the ExceptionHandler object.