com.filenet.api.exception

Class EngineRuntimeException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.lang.RuntimeException
          • com.filenet.api.exception.EngineRuntimeException
  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable
    Direct Known Subclasses:
    EventExternalFailureException


    public class EngineRuntimeException
    extends java.lang.RuntimeException
    implements java.io.Externalizable
    Used for all unchecked exceptions. The exceptions are defined as ExceptionCode objects. EngineRuntimeException supports use of an error stack, as well as exception chaining (constructing a chain of exceptions by wrapping additional exceptions). You can use getAsErrorStack to do a stack trace of either the error stack or the exception chain.
    See Also:
    ExceptionCode, ErrorStack, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      EngineRuntimeException()
      This constructor exists for the implementation of the Externalizable interface.
      EngineRuntimeException(EngineRuntimeException cause, com.filenet.apiimpl.exception.ExceptionContext ctx, java.lang.Object[] ctxArgs)
      (FileNet internal use only) Specifies EngineRuntimeException cause, exception code, and context.
      EngineRuntimeException(ErrorStack errStack)
      Use this to implement an error stack, specifying the ErrorStack object to use for this instance.
      EngineRuntimeException(ExceptionCode code)
      Use this to specify only the ExceptionCode object for this exception.
      EngineRuntimeException(ExceptionCode code, java.lang.Object codeArg0)
      Use this to specify the ExceptionCode object and the specific value in use (code argument) when the error occurred for this exception.
      EngineRuntimeException(ExceptionCode code, java.lang.Object[] codeArgs)
      Use this to specify the ExceptionCode object and an array of specific values (code arguments) in use when the error occurred for this exception.
      EngineRuntimeException(ExceptionCode code, java.lang.Object[] codeArgs, com.filenet.apiimpl.exception.ExceptionContext ctx, java.lang.Object[] ctxArgs)
      (FileNet internal use only) Specifies exception code and context.
      EngineRuntimeException(ExceptionCode code, java.lang.Object[] codeArgs, com.filenet.apiimpl.exception.ExceptionContext ctx, java.lang.Object[] ctxArgs, com.filenet.apiimpl.exception.ExceptionContext addlCtx, java.lang.Object[] addlCtxArgs)
      (FileNet internal use only) Specifies exception code and context.
      EngineRuntimeException(ExceptionCode code, java.lang.Object codeArg0, com.filenet.apiimpl.exception.ExceptionContext ctx, java.lang.Object[] ctxArgs)
      Use this to specify the ExceptionCode object and the specific value in use (code argument) when the error occurred for this exception.
      EngineRuntimeException(java.lang.Throwable cause, ExceptionCode code, java.lang.Object[] codeArgs)
      Use this for exception chaining.
      EngineRuntimeException(java.lang.Throwable cause, ExceptionCode code, java.lang.Object[] codeArgs, com.filenet.apiimpl.exception.ExceptionContext ctx, java.lang.Object[] ctxArgs)
      (FileNet internal use only) Specifies Throwable cause, exception code, and context.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      ErrorStack getAsErrorStack()
      Returns the error stack, if an error stack is used; otherwise this instance is returned as an ErrorStack object.
      ExceptionCode getExceptionCode()
      Gets the ExceptionCode object specified for this instance.
      java.lang.String getLocalizedMessage()
      Gets a localized version of the description string (using the default locale) specified in the ExceptionCode object used for this instance.
      java.lang.String getMessage()
      Gets a localized version of the description string (using the default locale) specified in the ExceptionCode object used for this instance.
      static java.lang.Throwable mergeStackTraces(java.lang.Throwable current, java.lang.Throwable backGround)
      Merges the stack trace elements from two threads and returns it as a single stack trace.
      void readExternal(java.io.ObjectInput s)
      Reads this instance from the underlying stream and stores it in the error stack.
      java.lang.String toString()
      Returns a description of this exception.
      void writeExternal(java.io.ObjectOutput s)
      Writes this instance to the underlying stream.
      • Methods inherited from class java.lang.Throwable

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

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

      • EngineRuntimeException

        public EngineRuntimeException()
        This constructor exists for the implementation of the Externalizable interface. It is not useful, in practice, for any other purpose.
      • EngineRuntimeException

        public EngineRuntimeException(ErrorStack errStack)
        Use this to implement an error stack, specifying the ErrorStack object to use for this instance. If unspecified, an error stack is not used.
        Parameters:
        errStack - An ErrorStack object to use.
      • EngineRuntimeException

        public EngineRuntimeException(ExceptionCode code,
                              java.lang.Object[] codeArgs)
        Use this to specify the ExceptionCode object and an array of specific values (code arguments) in use when the error occurred for this exception.
        Parameters:
        code - The ExceptionCode object to use.
        codeArgs - An Object array containing the code arguments. This can be null.
      • EngineRuntimeException

        public EngineRuntimeException(ExceptionCode code)
        Use this to specify only the ExceptionCode object for this exception.
        Parameters:
        code - The ExceptionCode object to use.
      • EngineRuntimeException

        public EngineRuntimeException(ExceptionCode code,
                              java.lang.Object codeArg0)
        Use this to specify the ExceptionCode object and the specific value in use (code argument) when the error occurred for this exception.
        Parameters:
        code - The ExceptionCode object to use.
        codeArg0 - An Object containing the code argument. This can be null.
      • EngineRuntimeException

        public EngineRuntimeException(ExceptionCode code,
                              java.lang.Object codeArg0,
                              com.filenet.apiimpl.exception.ExceptionContext ctx,
                              java.lang.Object[] ctxArgs)
        Use this to specify the ExceptionCode object and the specific value in use (code argument) when the error occurred for this exception.
        Parameters:
        code - The ExceptionCode object to use.
        codeArg0 - An Object containing the code argument. This can be null.
        ctx - Used to localize the context message.
        ctxArgs - An Object array containing the context arguments.
      • EngineRuntimeException

        public EngineRuntimeException(java.lang.Throwable cause,
                              ExceptionCode code,
                              java.lang.Object[] codeArgs)
        Use this for exception chaining. The ExceptionCode object and an array of specific values (code arguments) in use when the error occurred for this (wrapping) exception. The Throwable object specified is wrapped (nested) within this exception.
        Parameters:
        cause - A java.lang.Throwable object containing the exception to wrap.
        code - The ExceptionCode object to use.
        codeArgs - An Object array containing the code arguments. This can be null.
      • EngineRuntimeException

        public EngineRuntimeException(ExceptionCode code,
                              java.lang.Object[] codeArgs,
                              com.filenet.apiimpl.exception.ExceptionContext ctx,
                              java.lang.Object[] ctxArgs)
        (FileNet internal use only) Specifies exception code and context.
        Parameters:
        code - The ExceptionCode object to use.
        codeArgs - An Object array containing the code arguments.
        ctx - Used to localize the context message.
        ctxArgs - An Object array containing the context arguments.
      • EngineRuntimeException

        public EngineRuntimeException(ExceptionCode code,
                              java.lang.Object[] codeArgs,
                              com.filenet.apiimpl.exception.ExceptionContext ctx,
                              java.lang.Object[] ctxArgs,
                              com.filenet.apiimpl.exception.ExceptionContext addlCtx,
                              java.lang.Object[] addlCtxArgs)
        (FileNet internal use only) Specifies exception code and context.
        Parameters:
        code - The ExceptionCode object to use.
        codeArgs - An Object array containing the code arguments.
        ctx - Used to localize the context message.
        ctxArgs - An Object array containing the context arguments.
        addlCtx - Used to localize the additional context message.
        addlCtxArgs - An Object array containing the additional context arguments.
      • EngineRuntimeException

        public EngineRuntimeException(java.lang.Throwable cause,
                              ExceptionCode code,
                              java.lang.Object[] codeArgs,
                              com.filenet.apiimpl.exception.ExceptionContext ctx,
                              java.lang.Object[] ctxArgs)
        (FileNet internal use only) Specifies Throwable cause, exception code, and context.
        Parameters:
        cause - A java.lang.Throwable object containing the exception to wrap.
        code - The ExceptionCode object to use.
        codeArgs - An Object array containing the code arguments.
        ctx - Used to localize context message.
        ctxArgs - An Object array containing the context arguments.
      • EngineRuntimeException

        public EngineRuntimeException(EngineRuntimeException cause,
                              com.filenet.apiimpl.exception.ExceptionContext ctx,
                              java.lang.Object[] ctxArgs)
        (FileNet internal use only) Specifies EngineRuntimeException cause, exception code, and context.
        Parameters:
        cause - An EngineRuntimeException containing the exception to wrap. The exception code and its argument array are retrieved from this object.
        ctx - Used to localize context message.
        ctxArgs - An Object array containing the context arguments.
    • Method Detail

      • getExceptionCode

        public ExceptionCode getExceptionCode()
        Gets the ExceptionCode object specified for this instance.
        Returns:
        The ExceptionCode object for this exception.
      • getMessage

        public java.lang.String getMessage()
        Gets a localized version of the description string (using the default locale) specified in the ExceptionCode object used for this instance. This method overrides java.lang.Throwable.getMessage.
        Overrides:
        getMessage in class java.lang.Throwable
        Returns:
        A String containing the localized exception description.
      • getLocalizedMessage

        public java.lang.String getLocalizedMessage()
        Gets a localized version of the description string (using the default locale) specified in the ExceptionCode object used for this instance. This method overrides java.lang.Throwable.getLocalizedMessage.
        Overrides:
        getLocalizedMessage in class java.lang.Throwable
        Returns:
        A String containing the localized exception description.
      • getAsErrorStack

        public ErrorStack getAsErrorStack()
        Returns the error stack, if an error stack is used; otherwise this instance is returned as an ErrorStack object. The stack can contain an exception chain (if the instance was created using EngineRuntimeException(Throwable, ExceptionCode, Object[]).
        Returns:
        An ErrorStack object containing an exception or exceptions from either the error stack or this instance.
      • toString

        public java.lang.String toString()
        Returns a description of this exception. The result is the concatenation of the following:
        • The name of this exception's class
        • The name of the exception code
        • The localized error message
        • Extra info, such as a failedBatchItem=#
        • The exception's error stack enclosed in errorStack={ ... } if applicable
        Overrides:
        toString in class java.lang.Throwable
        Returns:
        A String representation of this exception.
      • writeExternal

        public void writeExternal(java.io.ObjectOutput s)
                           throws java.io.IOException
        Writes this instance to the underlying stream.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Parameters:
        s - A java.io.ObjectOutput object representing this instance.
        Throws:
        java.io.IOException - if an IO error occurs.
      • readExternal

        public void readExternal(java.io.ObjectInput s)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Reads this instance from the underlying stream and stores it in the error stack.
        Specified by:
        readExternal in interface java.io.Externalizable
        Parameters:
        s - A java.io.ObjectInput object representing this instance.
        Throws:
        java.io.IOException - if an IO error occurs, or the class cannot be found.
        java.lang.ClassNotFoundException
      • mergeStackTraces

        public static java.lang.Throwable mergeStackTraces(java.lang.Throwable current,
                                           java.lang.Throwable backGround)
        Merges the stack trace elements from two threads and returns it as a single stack trace. It is especially useful to merge the threaded stack traces when the background thread raises an exception.
        Parameters:
        current - A java.lang.Throwable object containing the stack trace elements for the current thread.
        backGround - A java.lang.Throwable object containing the stack trace elements for the background thread.
        Returns:
        A new java.lang.Throwable object containing the merged stack trace elements.

© Copyright IBM Corporation 2006, 2013. All rights reserved.