/**
*
*/
package de.axone.exception.codify;
/**
* Can be implemented by applications' exceptions in order to provide further
* information about the kind of exception.
*
* This interface can be used to distinguish between applications own exceptions
* and those generated by components. At list a little bit.
*
* You will set this to:
* <code>getComponentName(){ return null; }</code>
* <code>isComponent(){ return false; }</code>
* for exceptions generated by your application
*
* of
* <code>getComponentName(){ return "Hibernate"; }</code>
* <code>isComponent(){ return true; }</code>
* if you are Gavin King
*
* @author flo
*/
public interface Codein {
/**
* Returns the application's or component's name which generated the exception
*
* Ideally every component would maintain it's own exception hierarchy. This is
* not going to happen and would never be complete. But you can use this to give
* a hint to what module this exception belongs.
*
* Using dot notation is encouraged. e.g. use YOURAPPNAME.MODULE
*
* If this method returns a value other then NULL this value is used as application
* name when reporting. Otherwise or when not implementing this interface the
* configured application name is used.
*
* @return the component's name
*/
public String getComponentName();
/**
* Set to true in order to define this exception as a component exception. Component
* exceptions are thrown by components like hibernate, log4j or whatever you use.
*
* Set this to false for exceptions your main program generates.
*
* Since the most interessting exceptions are those of the components
* for exceptions which don't use this interface TRUE is presumed.
*
* @return true if this is a component (s.a.)
*/
public boolean isComponent();
}