ak.err
Class AppError

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--ak.err.AppError
Direct Known Subclasses:
ConnErr, DataErr, DBErr, Trace, UnexpectedErr

public class AppError
extends java.lang.Exception
implements IF_AppError

Class AppErr represent any application error. This class is the superclass of any particular application error. It contains the whole functionality of an exception. The derived classes are differ only by constructor. Application error gets the action-information dynamically from a configuration file(e.g. per module/per application).

Version:
V1.1 Copyright(c)2000 Alexej Kupin
See Also:
Serialized Form

Field Summary
protected  AppErrorItem errItem
           
protected  boolean m_bDisplay
           
protected  boolean m_bFullInfo
           
protected  boolean m_bMsgFile
           
protected  boolean m_bSuccess
           
protected  boolean m_bTrace
           
protected  java.lang.String m_sName
           
protected  java.util.Vector m_vMedia
           
 
Fields inherited from class java.lang.Throwable
backtrace, detailMessage, serialVersionUID
 
Constructor Summary
AppError()
          Default constructor
AppError(AppErrorItem err)
          Constructor with AppErrItem
AppError(java.lang.String sModul)
          Constructor with init-file
 
Method Summary
 void addComponent(java.lang.String sComponent)
          user may use this function to indicate in which class, which method is the error occured(nested errors)
 void addInfo(java.lang.String sInfo)
          user may use this function to keep tech-information separately. specialy for communication. (e.g.
 void addParam(java.lang.String sParam)
          user may use this function to add the information about the parameters which causes this error(e.g.
protected  void CheckFile(java.lang.String sPath, java.lang.String sTemp)
          CheckFile: Checks the max-size of log-file
 AppErrorItem getErrItem()
          gets the error description object(ErrItem)
 java.lang.String getMessage()
          gets the error message string
 java.lang.String GetPath()
          GetPath of the init-file (default)
protected  java.lang.String GetPath(boolean bError)
          GetPath of the init-file If bError=true,path of the default log-file
 java.lang.String GetPath(java.lang.String sName)
          GetPath of the init-file (for a given name)
protected  java.lang.String GetPath(java.lang.String sName, boolean bError)
          GetPath of the init-file If bError=true,path of the default log-file
protected  void Init(java.lang.String sModul)
          Init
protected  void InitDefault()
          InitDefault
protected  IF_LogMedia loadMedia(java.lang.String sPath)
          loads the external log-media dynamicaly (The classpath to the media should be available)
 void log()
          logs the error description information
 void log(java.lang.String sMSG)
          logs the message
 java.lang.String MakeLog()
          gets the error message string
 java.lang.String ObjectToString()
          In Order to pass this error over CORBA/RMI We need to define two conversion methods: StringToObject(String sObj);ObjectToString();
protected  boolean Read(java.lang.String sInitFile)
          Read from Init-file
protected  java.lang.String resolveMSG(java.lang.String sMsgShort)
          Resolve Message (from Message-file)
 void SetEnv(java.lang.String sApp, java.lang.String sSeverity, java.lang.String sCategory)
          Delegate methods to access error Item: Sets error environment: - Application Name (-> config file) - Error severity(e.g.
 void SetMsg(java.lang.String sMsg, java.lang.String sMsgShort, java.lang.String sDoAction)
          Delegate methods to access error Item: Sets error message: - Full message(e.g. for log-file) - Short message(e.g. for user) - Recomended action
 void show()
          shows the information in an message-box (only if DISPLAY_FLG is ON; see config-file)
 void show(java.lang.String sMSG)
          shows the message in an message-box (only if DISPLAY_FLG is ON; see config-file)
 boolean showAsk()
          shows the information in an ask-box (only if DISPLAY_FLG is ON; see config-file)
 boolean showAsk(java.lang.String sMSG)
          shows the message in an ask-box (only if DISPLAY_FLG is ON; see config-file)
 boolean showError()
          shows the information in an error-box (only if DISPLAY_FLG is ON; see config-file)
 boolean showError(java.lang.String sMSG)
          shows the message in an error-box (only if DISPLAY_FLG is ON; see config-file)
 void showInfo()
          shows the information in an info-box (only if DISPLAY_FLG is ON; see config-file)
 void showInfo(java.lang.String sMSG)
          shows the message in an info-box (only if DISPLAY_FLG is ON; see config-file)
 void showWarning()
          shows the information in a warning-box (only if DISPLAY_FLG is ON; see config-file)
 void showWarning(java.lang.String sMSG)
          shows the message in a warning-box (only if DISPLAY_FLG is ON; see config-file)
 void StringToObject(java.lang.String sObj)
          In Order to pass this error over CORBA/RMI We need to define two conversion methods: StringToObject(String sObj);ObjectToString();
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace, printStackTrace0, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

errItem

protected AppErrorItem errItem

m_bSuccess

protected boolean m_bSuccess

m_sName

protected java.lang.String m_sName

m_bFullInfo

protected boolean m_bFullInfo

m_bDisplay

protected boolean m_bDisplay

m_bTrace

protected boolean m_bTrace

m_bMsgFile

protected boolean m_bMsgFile

m_vMedia

protected java.util.Vector m_vMedia
Constructor Detail

AppError

public AppError()
Default constructor

AppError

public AppError(AppErrorItem err)
Constructor with AppErrItem

AppError

public AppError(java.lang.String sModul)
Constructor with init-file
Method Detail

Init

protected void Init(java.lang.String sModul)
Init

InitDefault

protected void InitDefault()
InitDefault

Read

protected boolean Read(java.lang.String sInitFile)
Read from Init-file

resolveMSG

protected java.lang.String resolveMSG(java.lang.String sMsgShort)
Resolve Message (from Message-file)

CheckFile

protected void CheckFile(java.lang.String sPath,
                         java.lang.String sTemp)
CheckFile: Checks the max-size of log-file

loadMedia

protected IF_LogMedia loadMedia(java.lang.String sPath)
                         throws java.lang.Exception
loads the external log-media dynamicaly (The classpath to the media should be available)

GetPath

protected java.lang.String GetPath(boolean bError)
GetPath of the init-file If bError=true,path of the default log-file

GetPath

protected java.lang.String GetPath(java.lang.String sName,
                                   boolean bError)
GetPath of the init-file If bError=true,path of the default log-file

StringToObject

public void StringToObject(java.lang.String sObj)
In Order to pass this error over CORBA/RMI We need to define two conversion methods: StringToObject(String sObj);ObjectToString();
Specified by:
StringToObject in interface IF_AppError

ObjectToString

public java.lang.String ObjectToString()
In Order to pass this error over CORBA/RMI We need to define two conversion methods: StringToObject(String sObj);ObjectToString();
Specified by:
ObjectToString in interface IF_AppError

getErrItem

public AppErrorItem getErrItem()
gets the error description object(ErrItem)
Specified by:
getErrItem in interface IF_AppError

GetPath

public java.lang.String GetPath()
GetPath of the init-file (default)
Specified by:
GetPath in interface IF_AppError

GetPath

public java.lang.String GetPath(java.lang.String sName)
GetPath of the init-file (for a given name)
Specified by:
GetPath in interface IF_AppError

SetEnv

public void SetEnv(java.lang.String sApp,
                   java.lang.String sSeverity,
                   java.lang.String sCategory)
Delegate methods to access error Item: Sets error environment: - Application Name (-> config file) - Error severity(e.g. FATAL/MINOR) - Category(e.g. DB/CONN/SYSTEM)
Specified by:
SetEnv in interface IF_AppError

SetMsg

public void SetMsg(java.lang.String sMsg,
                   java.lang.String sMsgShort,
                   java.lang.String sDoAction)
Delegate methods to access error Item: Sets error message: - Full message(e.g. for log-file) - Short message(e.g. for user) - Recomended action
Specified by:
SetMsg in interface IF_AppError

addParam

public void addParam(java.lang.String sParam)
user may use this function to add the information about the parameters which causes this error(e.g. UID expired!)
Specified by:
addParam in interface IF_AppError

addComponent

public void addComponent(java.lang.String sComponent)
user may use this function to indicate in which class, which method is the error occured(nested errors)
Specified by:
addComponent in interface IF_AppError

addInfo

public void addInfo(java.lang.String sInfo)
user may use this function to keep tech-information separately. specialy for communication. (e.g. "ORA-125-09" or "wrong port:8717")
Specified by:
addInfo in interface IF_AppError

MakeLog

public java.lang.String MakeLog()
gets the error message string

getMessage

public java.lang.String getMessage()
gets the error message string
Specified by:
getMessage in interface IF_AppError
Overrides:
getMessage in class java.lang.Throwable

log

public void log()
logs the error description information
Specified by:
log in interface IF_AppError

log

public void log(java.lang.String sMSG)
logs the message
Specified by:
log in interface IF_AppError

show

public void show()
shows the information in an message-box (only if DISPLAY_FLG is ON; see config-file)
Specified by:
show in interface IF_AppError

show

public void show(java.lang.String sMSG)
shows the message in an message-box (only if DISPLAY_FLG is ON; see config-file)
Specified by:
show in interface IF_AppError

showInfo

public void showInfo()
shows the information in an info-box (only if DISPLAY_FLG is ON; see config-file)
Specified by:
showInfo in interface IF_AppError

showInfo

public void showInfo(java.lang.String sMSG)
shows the message in an info-box (only if DISPLAY_FLG is ON; see config-file)
Specified by:
showInfo in interface IF_AppError

showWarning

public void showWarning()
shows the information in a warning-box (only if DISPLAY_FLG is ON; see config-file)
Specified by:
showWarning in interface IF_AppError

showWarning

public void showWarning(java.lang.String sMSG)
shows the message in a warning-box (only if DISPLAY_FLG is ON; see config-file)
Specified by:
showWarning in interface IF_AppError

showError

public boolean showError()
shows the information in an error-box (only if DISPLAY_FLG is ON; see config-file)
Specified by:
showError in interface IF_AppError

showError

public boolean showError(java.lang.String sMSG)
shows the message in an error-box (only if DISPLAY_FLG is ON; see config-file)
Specified by:
showError in interface IF_AppError

showAsk

public boolean showAsk()
shows the information in an ask-box (only if DISPLAY_FLG is ON; see config-file)
Specified by:
showAsk in interface IF_AppError

showAsk

public boolean showAsk(java.lang.String sMSG)
shows the message in an ask-box (only if DISPLAY_FLG is ON; see config-file)
Specified by:
showAsk in interface IF_AppError