Package org.osgi.framework
Class ServiceException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.osgi.framework.ServiceException
-
- All Implemented Interfaces:
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.
- Since:
- 1.5
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description 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.
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetType()Returns the type for this exception orUNSPECIFIEDif the type was unspecified or unknown.
-
-
-
Field Detail
-
UNSPECIFIED
public static final int UNSPECIFIED
No exception type is unspecified.- See Also:
- Constant Field Values
-
UNREGISTERED
public static final int UNREGISTERED
The service has been unregistered.- See Also:
- Constant Field Values
-
FACTORY_ERROR
public static final int FACTORY_ERROR
The service factory produced an invalid service object.- See Also:
- Constant Field Values
-
FACTORY_EXCEPTION
public static final int FACTORY_EXCEPTION
The service factory threw an exception.- See Also:
- Constant Field Values
-
SUBCLASSED
public static final int SUBCLASSED
The exception is a subclass of ServiceException. The subclass should be examined for the type of the exception.- See Also:
- Constant Field Values
-
REMOTE
public static final int REMOTE
An error occurred invoking a remote service.- See Also:
- Constant Field Values
-
FACTORY_RECURSION
public static final int FACTORY_RECURSION
The service factory resulted in a recursive call to itself for the requesting bundle.- Since:
- 1.6
- See Also:
- Constant Field Values
-
ASYNC_ERROR
public static final int ASYNC_ERROR
An asynchronous operation was unable to obtain the service.- Since:
- 1.8
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ServiceException
public ServiceException(java.lang.String msg, java.lang.Throwable cause)Creates aServiceExceptionwith the specified message and exception cause.- Parameters:
msg- The associated message.cause- The cause of this exception.
-
ServiceException
public ServiceException(java.lang.String msg)
Creates aServiceExceptionwith the specified message.- Parameters:
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.- Parameters:
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.- Parameters:
msg- The message.type- The type for this exception.
-
-