类 ServiceException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.osgi.framework.ServiceException
-
- 所有已实现的接口:
java.io.Serializable
public class ServiceException extends java.lang.RuntimeExceptionA service exception used to indicate that a service problem occurred.A
ServiceExceptionobject 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 ofServiceException. When subclassing, the subclass should set the type toSUBCLASSEDto indicate thatServiceExceptionhas been subclassed.This exception conforms to the general purpose exception chaining mechanism.
- 从以下版本开始:
- 1.5
- 作者:
- $Id: 32a515460813c702b127f65dda91cd23781b2a98 $
- 另请参阅:
- 序列化表格
-
-
字段概要
字段 修饰符和类型 字段 说明 static intASYNC_ERRORAn asynchronous operation was unable to obtain the service.static intFACTORY_ERRORThe service factory produced an invalid service object.static intFACTORY_EXCEPTIONThe service factory threw an exception.static intFACTORY_RECURSIONThe service factory resulted in a recursive call to itself for the requesting bundle.static intREMOTEAn error occurred invoking a remote service.static intSUBCLASSEDThe exception is a subclass of ServiceException.static intUNREGISTEREDThe service has been unregistered.static intUNSPECIFIEDNo exception type is unspecified.
-
构造器概要
构造器 构造器 说明 ServiceException(java.lang.String msg)Creates aServiceExceptionwith the specified message.ServiceException(java.lang.String msg, int type)Creates aServiceExceptionwith the specified message and type.ServiceException(java.lang.String msg, int type, java.lang.Throwable cause)Creates aServiceExceptionwith the specified message, type and exception cause.ServiceException(java.lang.String msg, java.lang.Throwable cause)Creates aServiceExceptionwith the specified message and exception cause.
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 intgetType()Returns the type for this exception orUNSPECIFIEDif the type was unspecified or unknown.
-
-
-
字段详细资料
-
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 aServiceExceptionwith the specified message and exception cause.- 参数:
msg- The associated message.cause- The cause of this exception.
-
ServiceException
public ServiceException(java.lang.String msg)
Creates aServiceExceptionwith the specified message.- 参数:
msg- The message.
-
ServiceException
public ServiceException(java.lang.String msg, int type, java.lang.Throwable cause)Creates aServiceExceptionwith 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 aServiceExceptionwith the specified message and type.- 参数:
msg- The message.type- The type for this exception.
-
-