com.ibm.events

Class EventsException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • com.ibm.events.EventsException
  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    CatalogException, CbeVersionNotSupportedException, DataStoreConnectionFailureException, com.ibm.events.datastore.DataStoreException, DataStoreNotEnabledException, EmitterException, EventGroupNotDefinedException, EventUpdatesNotSupportedException, InvalidNotificationTypeException


    public class EventsException
    extends java.lang.Exception
    The EventsException class is the base exception that all Common Event Infrastructure exceptions should inherit from. This class provides support for exception chaining semantics and localized (language-specific) messages.

    Exceptions that subclass this exception need to add only the various constructors and inherit everything else from this class.

    An EventsException contains the following components:

    • A key, which selects the text to be displayed from the message file. (Separating the text from the classes that use the text. This enables the text to be translated into different national languages.)
    • A message file, which contains a set of messages that might be displayed. Entries in the message file are stored as key=value pairs.
    • A set of Objects which can be inserted into the message text. These parameters are required only if the message expects them. These Objects are processed according to the rules of the java.text.MessageFormat class.
    • A nested Exception whose message text will be displayed with the text of this EventsException.

    Since:
    5.1.0
    Version:
    1.2 5/28/14
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      EventsException()
      Constructs a new EventsException with a null detail message and an uninitialized cause field.
      EventsException(java.lang.String message)
      Constructs a new EventsException with the specified detail message and an uninitialized cause field.
      EventsException(java.lang.String key, java.lang.String file, java.lang.Object[] parms)
      Constructs a new EventsException with a detail message and message translation information (resource bundle, message key and message substitutions).
      EventsException(java.lang.String key, java.lang.String file, java.lang.Object[] parms, java.lang.Throwable cause)
      Constructs a new EventsException with a detail message, message translation information (resource bundle, message key and message substitutions), and a nested exception.
      EventsException(java.lang.String message, java.lang.Throwable cause)
      Constructs a new EventsException with a null detail message and a cause field set to the specified java.lang.Throwable.
      EventsException(java.lang.Throwable cause)
      Constructs a new EventsException with a null detail message and a cause field set to the specified java.lang.Throwable.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.Throwable getCause()
      Returns the java.lang.Throwable that is considered to be the root cause of this EventsException.
      java.lang.String getFile()
      Gets the message file.
      java.lang.String getKey()
      Gets the message key.
      java.lang.String getLocalizedMessage()
      Gets the text of the exception message, which is translated into the current locale.
      java.lang.String getLocalizedMessage(java.util.Locale locale)
      Gets the text of the exception message, which is translated into the specified locale.
      java.lang.String getMessage()
      Gets the text of the exception message.
      java.lang.Object[] getParms()
      Gets the message parameters.
      java.lang.Throwable initCause(java.lang.Throwable cause)
      Initializes the cause field for this EventsException to the specified value.
      void printStackTrace()
      Prints this EventsException and its backtrace to System.err.
      void printStackTrace(java.io.PrintStream stream)
      Prints this EventsException and its backtrace to the specified java.io.PrintStream.
      void printStackTrace(java.io.PrintWriter writer)
      Prints this EventsException and its backtrace to the specified java.io.PrintWriter.
      • Methods inherited from class java.lang.Throwable

        fillInStackTrace, getStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

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

      • EventsException

        public EventsException()
        Constructs a new EventsException with a null detail message and an uninitialized cause field. The cause can subsequently be initialized using a call to the initCause(java.lang.Throwable) method.
      • EventsException

        public EventsException(java.lang.String message)
        Constructs a new EventsException with the specified detail message and an uninitialized cause field. The cause can subsequently be initialized using a call to the initCause(java.lang.Throwable) method.
        Parameters:
        message - The detail message. This value can be null.
      • EventsException

        public EventsException(java.lang.Throwable cause)
        Constructs a new EventsException with a null detail message and a cause field set to the specified java.lang.Throwable. Subsequent calls to the initCause(java.lang.Throwable) method on this instance will result in an exception. The value of the cause field can be retrieved at any time using the getCause() method.
        Parameters:
        cause - The nested exception or null if a nested exception is not appropriate.
      • EventsException

        public EventsException(java.lang.String message,
                       java.lang.Throwable cause)
        Constructs a new EventsException with a null detail message and a cause field set to the specified java.lang.Throwable. Subsequent calls to the initCause(java.lang.Throwable) method on this instance will result in an exception. The value of the cause field can be retrieved at any time using the getCause() method.
        Parameters:
        message - The detail message. This value can be null.
        cause - The nested exception or null if a nested exception is not appropriate.
      • EventsException

        public EventsException(java.lang.String key,
                       java.lang.String file,
                       java.lang.Object[] parms)
        Constructs a new EventsException with a detail message and message translation information (resource bundle, message key and message substitutions).
        Parameters:
        key - The message key.
        file - The name of the message file to use.
        parms - An array of elements to be inserted into the message.
      • EventsException

        public EventsException(java.lang.String key,
                       java.lang.String file,
                       java.lang.Object[] parms,
                       java.lang.Throwable cause)
        Constructs a new EventsException with a detail message, message translation information (resource bundle, message key and message substitutions), and a nested exception.
        Parameters:
        key - The message key.
        file - The name of the message file to use.
        parms - An array of elements to be inserted into the message.
        cause - The nested exception or null if a nested exception is not appropriate.
    • Method Detail

      • getCause

        public java.lang.Throwable getCause()
        Returns the java.lang.Throwable that is considered to be the root cause of this EventsException. A null value is returned if the root cause is nonexistent or unknown. The root cause is the throwable that caused this EventsException to get thrown.
        Overrides:
        getCause in class java.lang.Throwable
        Returns:
        The java.lang.Throwable that is the cause of this EventsException or null if the cause is nonexistent or unknown.
      • getFile

        public java.lang.String getFile()
        Gets the message file. The result is the message file associated with this text.

        Returns:
        The message file.
      • getKey

        public java.lang.String getKey()
        Gets the message key. The result is the key of the message associated with this text.

        Returns:
        The message key .
      • getLocalizedMessage

        public java.lang.String getLocalizedMessage()
        Gets the text of the exception message, which is translated into the current locale.
        Overrides:
        getLocalizedMessage in class java.lang.Throwable
        Returns:
        The localized exception message.
      • getLocalizedMessage

        public java.lang.String getLocalizedMessage(java.util.Locale locale)
        Gets the text of the exception message, which is translated into the specified locale.
        Parameters:
        locale - The locale to use for translation of the exception message or null to use the default locale.
        Returns:
        The localized exception message.
      • getMessage

        public java.lang.String getMessage()
        Gets the text of the exception message. The result is the same as that returned by getLocalizedMessage(Locale.ENGLISH).
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        The exception message.
      • getParms

        public java.lang.Object[] getParms()
        Gets the message parameters. The result is the parms of the message associated with this text.

        Returns:
        The message parameters.
      • initCause

        public java.lang.Throwable initCause(java.lang.Throwable cause)
                                      throws java.lang.IllegalStateException,
                                             java.lang.IllegalArgumentException
        Initializes the cause field for this EventsException to the specified value. The cause is the java.lang.Throwable that caused this EventsException to get thrown.
        Overrides:
        initCause in class java.lang.Throwable
        Parameters:
        cause - The nested exception or null if a nested exception is not appropriate.
        Returns:
        A reference to this java.lang.Throwable instance.
        Throws:
        java.lang.IllegalStateException - If this EventsException was created with a constructor that specified a cause or if this method has already been called on this object.
        java.lang.IllegalArgumentException - If the specified cause is this EventsException. An exception cannot be its own cause.
      • printStackTrace

        public void printStackTrace()
        Prints this EventsException and its backtrace to System.err.
        Overrides:
        printStackTrace in class java.lang.Throwable
      • printStackTrace

        public void printStackTrace(java.io.PrintStream stream)
        Prints this EventsException and its backtrace to the specified java.io.PrintStream.
        Overrides:
        printStackTrace in class java.lang.Throwable
        Parameters:
        stream - The java.io.PrintStream to use for output
      • printStackTrace

        public void printStackTrace(java.io.PrintWriter writer)
        Prints this EventsException and its backtrace to the specified java.io.PrintWriter.
        Overrides:
        printStackTrace in class java.lang.Throwable
        Parameters:
        writer - The java.io.PrintWriter to use for output
IBM Business Process ManagerTM
Release 8