issrg.SAWS
Class logReadingException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by issrg.SAWS.logReadingException
All Implemented Interfaces:
java.io.Serializable

public class logReadingException
extends java.lang.Exception

Author:
W.Xu
See Also:
Serialized Form

Constructor Summary
logReadingException()
          Creates a new instance of logReadingException
logReadingException(int errorCode)
           
logReadingException(int errorCode, int SequenceNo)
           
logReadingException(long cur, int se, java.security.MessageDigest md, byte[] acHash, int errorCode)
           
logReadingException(java.lang.String msg)
           
logReadingException(java.lang.String msg, java.lang.Throwable embed)
          This is how you are expected to embed another exception or any other throwable in.
 
Method Summary
 java.security.MessageDigest getAccMD()
           
 byte[] getAccumulatedHash()
           
 long getCurrentPos()
           
 java.lang.Throwable getEmbedded()
          This method returns the embedded object, if any.
 int getErrorCode()
           
 int getSequence()
           
 void printStackTrace()
           
 void printStackTrace(java.io.PrintStream ps)
           
 void printStackTrace(java.io.PrintWriter pw)
           
 void setErrorCode(int errorCodeIn)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

logReadingException

public logReadingException()
Creates a new instance of logReadingException


logReadingException

public logReadingException(int errorCode)

logReadingException

public logReadingException(int errorCode,
                           int SequenceNo)

logReadingException

public logReadingException(long cur,
                           int se,
                           java.security.MessageDigest md,
                           byte[] acHash,
                           int errorCode)

logReadingException

public logReadingException(java.lang.String msg)

logReadingException

public logReadingException(java.lang.String msg,
                           java.lang.Throwable embed)
This is how you are expected to embed another exception or any other throwable in. Now if you catch all Throwables and embed them into this exception, you can guarantee the caller will get nothing but the EmbeddedException. Now the caller can just display your default message, but also can inspect if anything more serious has caused the problem.

See Also:
getEmbedded()
Method Detail

setErrorCode

public void setErrorCode(int errorCodeIn)

getErrorCode

public int getErrorCode()

getCurrentPos

public long getCurrentPos()

getSequence

public int getSequence()

getAccMD

public java.security.MessageDigest getAccMD()

getAccumulatedHash

public byte[] getAccumulatedHash()

getEmbedded

public java.lang.Throwable getEmbedded()
This method returns the embedded object, if any. It can be null, if no exceptions were embedded, but if it is not null, you could figure out the cause of error more precisely.


printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter pw)
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream ps)
Overrides:
printStackTrace in class java.lang.Throwable