NetKernel APIs


com.ten60.netkernel.util
Class NetKernelException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.ten60.netkernel.util.NetKernelException
All Implemented Interfaces:
IXMLException, java.io.Serializable
Direct Known Subclasses:
NKFException

public class NetKernelException
extends java.lang.Exception
implements IXMLException

NetKernel exception is a generic exception class used for most exceptions in the NetKernel. It is nestable and allows multiple exceptions to be nested at any depth. Its most important characteristic is that its state can be recursively dumped as XML giving a clear picture of an exception scenario is a document.

See Also:
Serialized Form

Constructor Summary
NetKernelException(java.lang.String aMessage)
          Constructs an instance of NetKernelException with the specified detail message.
NetKernelException(java.lang.String aId, java.lang.String aMessage, java.lang.String aRequestId)
          Constructs an instance of NetKernelException with the specified Id, detail message, and request id.
 
Method Summary
 void addCause(java.lang.Throwable aThrowable)
          Adds an exception cause to this exception
 void appendXML(java.io.Writer aWriter)
          Recursively output the state of this exception and its causes to the given writer
 java.lang.Throwable getCause()
           
 java.lang.String getDeepestId()
          Return the id of the deepest underlying cause of this exception
 java.lang.String getId()
           
static void setTraceDepth(int aDepth)
          configure the depth that java exceptions stack traces will be captured
 java.lang.String toString()
          return XML representation of recursive exception pretty-printed with indent
static void writeThrowable(java.lang.Throwable aThrowable, java.io.Writer aWriter)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NetKernelException

public NetKernelException(java.lang.String aMessage)
Constructs an instance of NetKernelException with the specified detail message.

Parameters:
aMessage - the detail message.

NetKernelException

public NetKernelException(java.lang.String aId,
                          java.lang.String aMessage,
                          java.lang.String aRequestId)
Constructs an instance of NetKernelException with the specified Id, detail message, and request id.

Parameters:
aId - an id for the exception
aMessage - the detail message.
aRequestId - id of request that caused the exception
Method Detail

getId

public java.lang.String getId()

addCause

public void addCause(java.lang.Throwable aThrowable)
Adds an exception cause to this exception


getDeepestId

public java.lang.String getDeepestId()
Description copied from interface: IXMLException
Return the id of the deepest underlying cause of this exception

Specified by:
getDeepestId in interface IXMLException

appendXML

public void appendXML(java.io.Writer aWriter)
               throws java.io.IOException
Recursively output the state of this exception and its causes to the given writer

Specified by:
appendXML in interface IXMLException
Parameters:
aWriter - the writer to write exception to
Throws:
java.io.IOException - thrown if we fail to write to writer

writeThrowable

public static void writeThrowable(java.lang.Throwable aThrowable,
                                  java.io.Writer aWriter)
                           throws java.io.IOException
Throws:
java.io.IOException

toString

public java.lang.String toString()
return XML representation of recursive exception pretty-printed with indent

Overrides:
toString in class java.lang.Throwable

setTraceDepth

public static void setTraceDepth(int aDepth)
configure the depth that java exceptions stack traces will be captured


getCause

public java.lang.Throwable getCause()
Overrides:
getCause in class java.lang.Throwable

NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.