|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.jcoderz.commons.BaseException
public class BaseException
This is the Base class for all checked exceptions.
In the package overview you can find a
general statement when to use checked exceptions.
This class can never be directly used. Services must implement a general service specific Exception (generated initially by the service framework code generator) from which they can derive more concrete service specific exceptions. There are some common used exceptions available as direct subclasses of this class. If appropriate this classes must be used prior generating own classes.
Most functionality is implemented and documented by the
LoggableImpl which is used a member of
objects of this class. Other stuff is handled by the base class
Exception.
org.jcoderz.commons,
Serialized Form| Constructor Summary | |
|---|---|
protected |
BaseException(LogMessageInfo messageInfo)
Constructor getting an log message info. |
protected |
BaseException(LogMessageInfo messageInfo,
Throwable cause)
Constructor getting an log message info and a root exception. |
| Method Summary | |
|---|---|
void |
addParameter(String name,
Serializable value)
Add a new parameter to the Loggable. |
Throwable |
getCause()
Returns the cause of this throwable or null if the
cause is nonexistent or unknown. |
long |
getEventTime()
Returns the point in time when the event occurred. |
String |
getInstanceId()
Returns the instance identifier of the process that generated this Loggable. |
LogMessageInfo |
getLogMessageInfo()
Returns the LogMessageInfo for this Loggable. |
String |
getMessage()
Returns the (Detail) message of this loggable. |
String |
getNodeId()
Returns the ip-address or the host name where the Loggable was created. |
List |
getParameter(String name)
Returns a list of all parameters with the given name. |
Set |
getParameterNames()
Returns a set of available parameters. |
String |
getSourceClass()
Tries to find the source class name where this log event was fired. |
String |
getSourceMethod()
Tries to find the source method where this log event was fired. |
long |
getThreadId()
Returns the thread id of the thread that created this Loggable. |
String |
getThreadName()
Returns the thread name as it was valid at the time of creation of this Loggable. |
String |
getTrackingNumber()
Returns the (unique) tracking number of this Loggable instance. |
Throwable |
initCause(Throwable cause)
|
void |
log()
Logs this Loggable into the appropriate log
sink. |
protected void |
logCreation()
|
String |
toDetailedString()
The toString method of Loggable must dump out all
information stored within this loggable in a readable way. |
String |
toString()
The toString method of Loggable dumps the
String representation of the class name of the loggable
and the contained message. |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected BaseException(LogMessageInfo messageInfo)
messageInfo - the log message info for this exception
protected BaseException(LogMessageInfo messageInfo,
Throwable cause)
messageInfo - the log message info for this exceptioncause - the problem that caused this exception to be thrown| Method Detail |
|---|
public Throwable initCause(Throwable cause)
initCause in class Throwable
public final void addParameter(String name,
Serializable value)
Loggable.
All parameters are always added to the Loggable.
There is no way of changing or removing a parameter. Once the
Loggable was asked for one of it's values there
should not be a new parameter. Nevertheless
implementations of this interface MUST not throw an exception
if this happens.
Multiple parameters with the same name are stored within
the Loggable.
Values must be Serializable and have a useful
to String representation. If the value is not serializable
it might be sufficient to store the String representation
of the value. The Loggable is not responsible
to make a deep copy of the value. The calling code should
take care for this. To solve this a possible solution
would again be to use the String representation of the
value.
addParameter in interface Loggablename - the name of the parameter to be added.value - the value for the parameter.public String getInstanceId()
getInstanceId in interface Loggablepublic final String getMessage()
LogMessageInfo and parameters.
The field might get truncated on the presentation layer.
getMessage in interface LoggablegetMessage in class Throwablepublic final void log()
Loggable into the appropriate log
sink.
log in interface Loggablepublic Throwable getCause()
null if the
cause is nonexistent or unknown. (The cause is the throwable
that caused this throwable to get thrown.)
The returned object might be a Loggable.
getCause in interface LoggablegetCause in class Throwablenull if the
cause is nonexistent or unknown.public long getEventTime()
Loggable object was created.
getEventTime in interface Loggablepublic LogMessageInfo getLogMessageInfo()
LogMessageInfo for this Loggable.
getLogMessageInfo in interface LoggableLogMessageInfo for this Loggable.public String getNodeId()
getNodeId in interface Loggablepublic List getParameter(String name)
name must not start with an _
character. These are reserved for internal use.
getParameter in interface Loggablename - The name of the parameter to be retrieved.
public Set getParameterNames()
getParameterNames in interface Loggablepublic long getThreadId()
Loggable.
getThreadId in interface LoggableLoggable.public String getTrackingNumber()
Loggable instance.
getTrackingNumber in interface LoggableLoggable instance.public String getSourceClass()
getSourceClass in interface LoggableStackTraceElement.getClassName()public String getSourceMethod()
getSourceMethod in interface LoggableStackTraceElement.getMethodName(),
StackTraceElement.getLineNumber()public String getThreadName()
Loggable.
getThreadName in interface LoggableLoggable.Thread.getName()public String toString()
Loggable dumps the
String representation of the class name of the loggable
and the contained message.
toString in interface LoggabletoString in class ThrowableLoggable.public String toDetailedString()
Loggable must dump out all
information stored within this loggable in a readable way. This
includes the information of possible nested data.
toDetailedString in interface LoggableLoggable.protected final void logCreation()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||