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:
Serializable
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.
- Since:
- 1.5
- Author:
- $Id: 32a515460813c702b127f65dda91cd23781b2a98 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAn asynchronous operation was unable to obtain the service.static final intThe service factory produced an invalid service object.static final intThe service factory threw an exception.static final intThe service factory resulted in a recursive call to itself for the requesting bundle.static final intAn error occurred invoking a remote service.static final intThe exception is a subclass of ServiceException.static final intThe service has been unregistered.static final intNo exception type is unspecified. -
Constructor Summary
ConstructorsConstructorDescriptionServiceException(String msg) Creates aServiceExceptionwith the specified message.ServiceException(String msg, int type) Creates aServiceExceptionwith the specified message and type.ServiceException(String msg, int type, Throwable cause) Creates aServiceExceptionwith the specified message, type and exception cause.ServiceException(String msg, Throwable cause) Creates aServiceExceptionwith the specified message and exception cause. -
Method Summary
Modifier and TypeMethodDescriptionintgetType()Returns the type for this exception orUNSPECIFIEDif the type was unspecified or unknown.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
UNSPECIFIED
public static final int UNSPECIFIEDNo exception type is unspecified.- See Also:
-
UNREGISTERED
public static final int UNREGISTEREDThe service has been unregistered.- See Also:
-
FACTORY_ERROR
public static final int FACTORY_ERRORThe service factory produced an invalid service object.- See Also:
-
FACTORY_EXCEPTION
public static final int FACTORY_EXCEPTIONThe service factory threw an exception.- See Also:
-
SUBCLASSED
public static final int SUBCLASSEDThe exception is a subclass of ServiceException. The subclass should be examined for the type of the exception.- See Also:
-
REMOTE
public static final int REMOTEAn error occurred invoking a remote service.- See Also:
-
FACTORY_RECURSION
public static final int FACTORY_RECURSIONThe service factory resulted in a recursive call to itself for the requesting bundle.- Since:
- 1.6
- See Also:
-
ASYNC_ERROR
public static final int ASYNC_ERRORAn asynchronous operation was unable to obtain the service.- Since:
- 1.8
- See Also:
-
-
Constructor Details
-
ServiceException
Creates aServiceExceptionwith the specified message and exception cause.- Parameters:
msg- The associated message.cause- The cause of this exception.
-
ServiceException
Creates aServiceExceptionwith the specified message.- Parameters:
msg- The message.
-
ServiceException
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
Creates aServiceExceptionwith the specified message and type.- Parameters:
msg- The message.type- The type for this exception.
-
-
Method Details
-
getType
public int getType()Returns the type for this exception orUNSPECIFIEDif the type was unspecified or unknown.- Returns:
- The type of this exception.
-