类 ServiceException

  • 所有已实现的接口:
    java.io.Serializable

    public class ServiceException
    extends java.lang.RuntimeException
    A service exception used to indicate that a service problem occurred.

    A ServiceException object is created by the Framework or service implementation to denote an exception condition in the service. A type code is used to identify the exception type for future extendability. Service implementations may also create subclasses of ServiceException. When subclassing, the subclass should set the type to SUBCLASSED to indicate that ServiceException has been subclassed.

    This exception conforms to the general purpose exception chaining mechanism.

    从以下版本开始:
    1.5
    作者:
    $Id: 32a515460813c702b127f65dda91cd23781b2a98 $
    另请参阅:
    序列化表格
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static int ASYNC_ERROR
      An asynchronous operation was unable to obtain the service.
      static int FACTORY_ERROR
      The service factory produced an invalid service object.
      static int FACTORY_EXCEPTION
      The service factory threw an exception.
      static int FACTORY_RECURSION
      The service factory resulted in a recursive call to itself for the requesting bundle.
      static int REMOTE
      An error occurred invoking a remote service.
      static int SUBCLASSED
      The exception is a subclass of ServiceException.
      static int UNREGISTERED
      The service has been unregistered.
      static int UNSPECIFIED
      No exception type is unspecified.
    • 构造器概要

      构造器 
      构造器 说明
      ServiceException​(java.lang.String msg)
      Creates a ServiceException with the specified message.
      ServiceException​(java.lang.String msg, int type)
      Creates a ServiceException with the specified message and type.
      ServiceException​(java.lang.String msg, int type, java.lang.Throwable cause)
      Creates a ServiceException with the specified message, type and exception cause.
      ServiceException​(java.lang.String msg, java.lang.Throwable cause)
      Creates a ServiceException with the specified message and exception cause.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      int getType()
      Returns the type for this exception or UNSPECIFIED if the type was unspecified or unknown.
      • 从类继承的方法 java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 字段详细资料

      • UNSPECIFIED

        public static final int UNSPECIFIED
        No exception type is unspecified.
        另请参阅:
        常量字段值
      • UNREGISTERED

        public static final int UNREGISTERED
        The service has been unregistered.
        另请参阅:
        常量字段值
      • FACTORY_ERROR

        public static final int FACTORY_ERROR
        The service factory produced an invalid service object.
        另请参阅:
        常量字段值
      • FACTORY_EXCEPTION

        public static final int FACTORY_EXCEPTION
        The service factory threw an exception.
        另请参阅:
        常量字段值
      • SUBCLASSED

        public static final int SUBCLASSED
        The exception is a subclass of ServiceException. The subclass should be examined for the type of the exception.
        另请参阅:
        常量字段值
      • REMOTE

        public static final int REMOTE
        An error occurred invoking a remote service.
        另请参阅:
        常量字段值
      • FACTORY_RECURSION

        public static final int FACTORY_RECURSION
        The service factory resulted in a recursive call to itself for the requesting bundle.
        从以下版本开始:
        1.6
        另请参阅:
        常量字段值
      • ASYNC_ERROR

        public static final int ASYNC_ERROR
        An asynchronous operation was unable to obtain the service.
        从以下版本开始:
        1.8
        另请参阅:
        常量字段值
    • 构造器详细资料

      • ServiceException

        public ServiceException​(java.lang.String msg,
                                java.lang.Throwable cause)
        Creates a ServiceException with the specified message and exception cause.
        参数:
        msg - The associated message.
        cause - The cause of this exception.
      • ServiceException

        public ServiceException​(java.lang.String msg)
        Creates a ServiceException with the specified message.
        参数:
        msg - The message.
      • ServiceException

        public ServiceException​(java.lang.String msg,
                                int type,
                                java.lang.Throwable cause)
        Creates a ServiceException with the specified message, type and exception cause.
        参数:
        msg - The associated message.
        type - The type for this exception.
        cause - The cause of this exception.
      • ServiceException

        public ServiceException​(java.lang.String msg,
                                int type)
        Creates a ServiceException with the specified message and type.
        参数:
        msg - The message.
        type - The type for this exception.
    • 方法详细资料

      • getType

        public int getType()
        Returns the type for this exception or UNSPECIFIED if the type was unspecified or unknown.
        返回:
        The type of this exception.