NetKernel APIs


com.ten60.netkernel.util
Class NetKernelException

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

public class NetKernelException
extends 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(String aMessage)
          Constructs an instance of NetKernelException with the specified detail message.
NetKernelException(String aId, String aMessage, String aRequestId)
          Constructs an instance of NetKernelException with the specified Id, detail message, and request id.
 
Method Summary
 void addCause(Throwable aThrowable)
          Adds an exception cause to this exception
 void appendXML(Writer aWriter)
          Recursively output the state of this exception and its causes to the given writer
 Throwable getCause()
           
 String getDeepestId()
          Return the id of the deepest underlying cause of this exception
 String getDeepestMessage()
           
 String getId()
           
static void setTraceDepth(int aDepth)
          configure the depth that java exceptions stack traces will be captured
 String toString()
          return XML representation of recursive exception pretty-printed with indent
static void writeThrowable(Throwable aThrowable, 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(String aMessage)
Constructs an instance of NetKernelException with the specified detail message.

Parameters:
aMessage - the detail message.

NetKernelException

public NetKernelException(String aId,
                          String aMessage,
                          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 String getId()

addCause

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


getDeepestId

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

Specified by:
getDeepestId in interface IXMLException

getDeepestMessage

public String getDeepestMessage()

appendXML

public void appendXML(Writer aWriter)
               throws 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:
IOException - thrown if we fail to write to writer

writeThrowable

public static void writeThrowable(Throwable aThrowable,
                                  Writer aWriter)
                           throws IOException
Throws:
IOException

toString

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


setTraceDepth

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


getCause

public Throwable getCause()

NetKernel APIs


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