de.smartics.exceptions.runtime
Class AbstractExceptionContextManager<T extends ExceptionContext>

Package class diagram package AbstractExceptionContextManager
java.lang.Object
  extended by de.smartics.exceptions.runtime.AbstractExceptionContextManager<T>
Type Parameters:
T - the type of the context served by this manager.
Direct Known Subclasses:
ExceptionContextManager, I18nExceptionContextManager

public abstract class AbstractExceptionContextManager<T extends ExceptionContext>
     
     
extends Object

Provides configuration information for exceptions per class loader.


Constructor Summary
AbstractExceptionContextManager()
           
 
Method Summary
protected  T fetchContext(ClassLoader classLoader)
          Fetches the most appropriate context for the given class loader.
protected abstract  T fetchContextFromService(ClassLoader classLoader)
          Returns the context configured by the service framework.
 T getContext(ClassLoader classLoader)
          Returns the exception configuration for the given class loader.
protected abstract  T getDefaultExceptionContext()
          Returns the default context provided by the subclass.
 void setContext(ClassLoader classLoader, T context)
          Sets the configuration for the given class loader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractExceptionContextManager

public AbstractExceptionContextManager()
Method Detail

getContext

public T getContext(ClassLoader classLoader)
Returns the exception configuration for the given class loader.

Parameters:
classLoader - the class loader whose exception configuration is requested.
Returns:
the exception configuration for the given class loader.

setContext

public void setContext(ClassLoader classLoader,
                       T context)
Sets the configuration for the given class loader.

Parameters:
classLoader - the class loader whose configuration is to be set.
context - the context for the class loader to set.

fetchContext

protected T fetchContext(ClassLoader classLoader)
Fetches the most appropriate context for the given class loader.

Parameters:
classLoader - the class loader whose exception context is requested.
Returns:
the context for the class loader or the default context if the class loader has none set for its own.

fetchContextFromService

protected abstract T fetchContextFromService(ClassLoader classLoader)
Returns the context configured by the service framework.

Parameters:
classLoader - the class loader to use.
Returns:
the context configured by the service framework.

getDefaultExceptionContext

protected abstract T getDefaultExceptionContext()
Returns the default context provided by the subclass.

Returns:
the default context provided by the subclass.


Copyright © 2007-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.