com.emarsys.ecommon.exceptions.handling
Class ExceptionHandlingFactory<E extends java.lang.Exception,T extends java.lang.Exception>

java.lang.Object
  extended by com.emarsys.ecommon.exceptions.handling.ExceptionHandlingFactory<E,T>

public class ExceptionHandlingFactory<E extends java.lang.Exception,T extends java.lang.Exception>
extends java.lang.Object

An ExceptionHandlingFactory provides a more convient way to create objects needed in a pluggable ExceptionHandling.

This class was created because of the clumsy interface the of the PEH due to its generics, maybe the typesafety will be ommitet in favor of a slick syntax and API in the future.

NOTE: the whole pluggable exception handling (PEH) module is highly experimental and still under heavy development, don't use it in production code unless you know what you're doing!

Author:
Michael "kULO" Kulovits

Constructor Summary
ExceptionHandlingFactory(java.lang.Class<E> handledExceptionClass, java.lang.Class<T> thrownExceptionClass)
           
 
Method Summary
static
<E extends java.lang.Exception,T extends java.lang.Exception>
ExceptionHandlingFactory<E,T>
getInstance(java.lang.Class<E> handledExceptionClass, java.lang.Class<T> thrownExceptionClass)
           
 ExceptionScenario<E,T> getScenarioInstance(java.lang.String name)
          Factory method to create similar ExceptionScenarios that differ only in their name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionHandlingFactory

public ExceptionHandlingFactory(java.lang.Class<E> handledExceptionClass,
                                java.lang.Class<T> thrownExceptionClass)
Parameters:
handledExceptionClass -
thrownExceptionClass -
Method Detail

getInstance

public static <E extends java.lang.Exception,T extends java.lang.Exception> ExceptionHandlingFactory<E,T> getInstance(java.lang.Class<E> handledExceptionClass,
                                                                                                                      java.lang.Class<T> thrownExceptionClass)
Type Parameters:
E -
T -
Parameters:
handledExceptionClass -
thrownExceptionClass -
Returns:

getScenarioInstance

public ExceptionScenario<E,T> getScenarioInstance(java.lang.String name)
Factory method to create similar ExceptionScenarios that differ only in their name.

Parameters:
name -
Returns:
a new ExceptionScenario instance with the specified name and the factories handled and thrown exception classes.


Copyright © 2010 emarsys AG. All Rights Reserved.