Package org.osgi.service.application
Class ApplicationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.osgi.service.application.ApplicationException
-
- All Implemented Interfaces:
java.io.Serializable
public class ApplicationException extends java.lang.Exception
This exception is used to indicate problems related to application lifecycle management.ApplicationException
object is created by the Application Admin to denote an exception condition in the lifecycle of an application.ApplicationException
s should not be created by developers.ApplicationException
s are associated with an error code. This code describes the type of problem reported in this exception. The possible codes are:-
APPLICATION_LOCKED
- The application couldn't be launched because it is locked. -
APPLICATION_NOT_LAUNCHABLE
- The application is not in launchable state. -
APPLICATION_INTERNAL_ERROR
- An exception was thrown by the application or its container during launch. -
APPLICATION_SCHEDULING_FAILED
- The scheduling of an application failed. -
APPLICATION_DUPLICATE_SCHEDULE_ID
- The application scheduling failed because the specified identifier is already in use. -
APPLICATION_EXITVALUE_NOT_AVAILABLE
- The exit value is not available for an application instance because the instance has not terminated. -
APPLICATION_INVALID_STARTUP_ARGUMENT
- One of the specified startup arguments is invalid, for example its type is not permitted.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
APPLICATION_DUPLICATE_SCHEDULE_ID
The application scheduling failed because the specified identifier is already in use.static int
APPLICATION_EXITVALUE_NOT_AVAILABLE
The exit value is not available for an application instance because the instance has not terminated.static int
APPLICATION_INTERNAL_ERROR
An exception was thrown by the application or the corresponding container during launch.static int
APPLICATION_INVALID_STARTUP_ARGUMENT
One of the specified startup arguments is invalid, for example its type is not permitted.static int
APPLICATION_LOCKED
The application couldn't be launched because it is locked.static int
APPLICATION_NOT_LAUNCHABLE
The application is not in launchable state, it'sApplicationDescriptor.APPLICATION_LAUNCHABLE
attribute is false.static int
APPLICATION_SCHEDULING_FAILED
The application schedule could not be created due to some internal error (for example, the schedule information couldn't be saved due to some storage error).
-
Constructor Summary
Constructors Constructor Description ApplicationException(int errorCode)
Creates anApplicationException
with the specified error code.ApplicationException(int errorCode, java.lang.String message)
Creates anApplicationException
with the specified error code.ApplicationException(int errorCode, java.lang.String message, java.lang.Throwable cause)
Creates aApplicationException
that wraps another exception.ApplicationException(int errorCode, java.lang.Throwable cause)
Creates aApplicationException
that wraps another exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Throwable
getCause()
Returns the cause of this exception ornull
if no cause was set.int
getErrorCode()
Returns the error code associated with this exception.
-
-
-
Field Detail
-
APPLICATION_LOCKED
public static final int APPLICATION_LOCKED
The application couldn't be launched because it is locked.- See Also:
- Constant Field Values
-
APPLICATION_NOT_LAUNCHABLE
public static final int APPLICATION_NOT_LAUNCHABLE
The application is not in launchable state, it'sApplicationDescriptor.APPLICATION_LAUNCHABLE
attribute is false.- See Also:
- Constant Field Values
-
APPLICATION_INTERNAL_ERROR
public static final int APPLICATION_INTERNAL_ERROR
An exception was thrown by the application or the corresponding container during launch. The exception is available fromgetCause()
.- See Also:
- Constant Field Values
-
APPLICATION_SCHEDULING_FAILED
public static final int APPLICATION_SCHEDULING_FAILED
The application schedule could not be created due to some internal error (for example, the schedule information couldn't be saved due to some storage error).- See Also:
- Constant Field Values
-
APPLICATION_DUPLICATE_SCHEDULE_ID
public static final int APPLICATION_DUPLICATE_SCHEDULE_ID
The application scheduling failed because the specified identifier is already in use.- See Also:
- Constant Field Values
-
APPLICATION_EXITVALUE_NOT_AVAILABLE
public static final int APPLICATION_EXITVALUE_NOT_AVAILABLE
The exit value is not available for an application instance because the instance has not terminated.- Since:
- 1.1
- See Also:
- Constant Field Values
-
APPLICATION_INVALID_STARTUP_ARGUMENT
public static final int APPLICATION_INVALID_STARTUP_ARGUMENT
One of the specified startup arguments is invalid, for example its type is not permitted.- Since:
- 1.1
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ApplicationException
public ApplicationException(int errorCode)
Creates anApplicationException
with the specified error code.- Parameters:
errorCode
- The code of the error
-
ApplicationException
public ApplicationException(int errorCode, java.lang.Throwable cause)
Creates aApplicationException
that wraps another exception.- Parameters:
errorCode
- The code of the errorcause
- The cause of this exception.
-
ApplicationException
public ApplicationException(int errorCode, java.lang.String message)
Creates anApplicationException
with the specified error code.- Parameters:
errorCode
- The code of the errormessage
- The associated message
-
ApplicationException
public ApplicationException(int errorCode, java.lang.String message, java.lang.Throwable cause)
Creates aApplicationException
that wraps another exception.- Parameters:
errorCode
- The code of the errormessage
- The associated message.cause
- The cause of this exception.
-
-
Method Detail
-
getCause
public java.lang.Throwable getCause()
Returns the cause of this exception ornull
if no cause was set.- Overrides:
getCause
in classjava.lang.Throwable
- Returns:
- The cause of this exception or
null
if no cause was set.
-
getErrorCode
public int getErrorCode()
Returns the error code associated with this exception.- Returns:
- The error code of this exception.
-
-