psdi.util

Class MXException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • psdi.util.MXException
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      java.lang.Throwable detail
      For nested exceptions, this will contain the original exception
      java.lang.Object[] params
      List of additional parameters that contain other information that can be used in an exception specific way.
    • Constructor Summary

      Constructors 
      Constructor and Description
      MXException(java.lang.String eg, java.lang.String ek)
      Constructor specifying the Error Group and Error Key
      MXException(java.lang.String eg, java.lang.String ek, java.lang.Object[] params)
      Constructor specifying the Error Group, Error Key and additonal information.
      MXException(java.lang.String eg, java.lang.String ek, java.lang.Object[] params, java.lang.Throwable t)
      Constructor specifying the Error Group, Error Key, additonal information and the exception that was the original cause.
      MXException(java.lang.String eg, java.lang.String ek, java.lang.Throwable t)
      Constructor specifying the Error Group, Error Key and the exception that was the original cause.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.String g, java.lang.String k)
      Is the exception 'equal' to the specified error group and key ?
      java.lang.Throwable getDetail()
      Get the nested exception.
      java.lang.String getDisplayMessage()
      Produce the message.
      java.lang.String getErrorAttr() 
      MaxType getErrorAttrValue() 
      java.lang.String getErrorCorrelationId() 
      java.lang.String getErrorGroup()
      General group of the error, e.g.
      java.lang.String getErrorKey()
      Get the key of the error in the error group.
      java.lang.String getErrorObjectName() 
      java.lang.String getForcedLangCode()
      Get the language the message will be thrown
      java.lang.String getMessage()
      Produce the message, including the message from the nested exception if there is one.
      java.lang.String getMessage(MboSetRemote remoteObj)
      Return the Exception's message.
      static java.util.Map getMetrics() 
      java.lang.Object[] getParameters()
      Return the parameters of the exception.
      boolean hasDetail()
      Deoes this exception have nested exceptions.
      boolean hasParameters()
      Does this exception have additional information specified as paramters ?
      static boolean isServerSide()
      Called to see if the MXException class believes it's being used in an MXServer and therefore should be doing logging.
      protected static void log(java.lang.Throwable t)
      Called to log an exception.
      static void reset() 
      void setErrorAttr(java.lang.String errorMeta) 
      void setErrorAttrValue(MaxType val) 
      void setErrorCorrelationId(java.lang.String errorCorrelationId) 
      void setErrorObjectName(java.lang.String errorObjectName) 
      void setForcedLangCode(java.lang.String langCode)
      Use this language to get the message from cache.
      static void setServerSide(boolean value)
      Called by the MXServer to indicate that the exceptions generated can be logged via the MonitorStream error output.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • detail

        public java.lang.Throwable detail
        For nested exceptions, this will contain the original exception
      • params

        public java.lang.Object[] params
        List of additional parameters that contain other information that can be used in an exception specific way. e.g. The name of a required field
    • Constructor Detail

      • MXException

        public MXException(java.lang.String eg,
                           java.lang.String ek)
        Constructor specifying the Error Group and Error Key
      • MXException

        public MXException(java.lang.String eg,
                           java.lang.String ek,
                           java.lang.Throwable t)
        Constructor specifying the Error Group, Error Key and the exception that was the original cause.
      • MXException

        public MXException(java.lang.String eg,
                           java.lang.String ek,
                           java.lang.Object[] params)
        Constructor specifying the Error Group, Error Key and additonal information.
      • MXException

        public MXException(java.lang.String eg,
                           java.lang.String ek,
                           java.lang.Object[] params,
                           java.lang.Throwable t)
        Constructor specifying the Error Group, Error Key, additonal information and the exception that was the original cause.
    • Method Detail

      • setServerSide

        public static void setServerSide(boolean value)
        Called by the MXServer to indicate that the exceptions generated can be logged via the MonitorStream error output.
      • isServerSide

        public static boolean isServerSide()
        Called to see if the MXException class believes it's being used in an MXServer and therefore should be doing logging.
      • log

        protected static void log(java.lang.Throwable t)
        Called to log an exception.
      • hasParameters

        public boolean hasParameters()
        Does this exception have additional information specified as paramters ?
        Returns:
        true = has parameters, false = does not have parameters
      • hasDetail

        public boolean hasDetail()
        Deoes this exception have nested exceptions.
        Returns:
      • getDetail

        public java.lang.Throwable getDetail()
        Get the nested exception.
        Returns:
      • getParameters

        public java.lang.Object[] getParameters()
        Return the parameters of the exception. NULL is returned if there are none !
        Returns:
        array of parameters (null if no parameters)
      • getErrorGroup

        public java.lang.String getErrorGroup()
        General group of the error, e.g. System, WorkOrder etc. These error groups usually correspond to a resouce bundle name that can be aquired thru the resolver class.
        Returns:
        error group
      • getErrorKey

        public java.lang.String getErrorKey()
        Get the key of the error in the error group.
        Returns:
        error key
      • equals

        public boolean equals(java.lang.String g,
                              java.lang.String k)
        Is the exception 'equal' to the specified error group and key ?
        Returns:
        true = equals the specified group and key, false = does not equal
      • getMessage

        public java.lang.String getMessage()
        Produce the message, including the message from the nested exception if there is one. If this method is called from the server side, the message in base language will be returned. If the method is called from the client site, only the message group and key will be returned. In order for the client to get a language specific message, the method getMessage(MboSetRemote) has to be used.
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        message text, including nested exception if one exists. If an error is caught by this method, the message text may include ClassNotFoundException or NoClassDefFoundError.
      • getErrorAttr

        public java.lang.String getErrorAttr()
      • setErrorAttr

        public void setErrorAttr(java.lang.String errorMeta)
      • setErrorAttrValue

        public void setErrorAttrValue(MaxType val)
      • getErrorAttrValue

        public MaxType getErrorAttrValue()
      • getErrorObjectName

        public java.lang.String getErrorObjectName()
      • setErrorObjectName

        public void setErrorObjectName(java.lang.String errorObjectName)
      • getErrorCorrelationId

        public java.lang.String getErrorCorrelationId()
      • setErrorCorrelationId

        public void setErrorCorrelationId(java.lang.String errorCorrelationId)
      • getDisplayMessage

        public java.lang.String getDisplayMessage()
        Produce the message.
        Returns:
        message text. If an error is caught by this method, the message text may include ClassNotFoundException or NoClassDefFoundError.
      • getMessage

        public java.lang.String getMessage(MboSetRemote remoteObj)
                                    throws MXException
        Return the Exception's message. The method will contact the server through the remote object to get the message in the language of the remote object's language code.
        Parameters:
        remoteObject - Remote Mbo set whose user info's language code will be used to lookup the message on the server.
        Throws:
        MXException
      • getForcedLangCode

        public java.lang.String getForcedLangCode()
        Get the language the message will be thrown
        Returns:
      • setForcedLangCode

        public void setForcedLangCode(java.lang.String langCode)
        Use this language to get the message from cache.
        Parameters:
        langCode -
      • getMetrics

        public static java.util.Map getMetrics()
      • reset

        public static void reset()