public class DeploymentException extends Exception
DeploymentException
always contains an error code (one
of the constants specified in this class), and may optionally contain the
textual description of the error condition and a nested cause exception.Modifier and Type | Field and Description |
---|---|
static int |
CODE_BAD_HEADER
Syntax error in any manifest header.
|
static int |
CODE_BUNDLE_NAME_ERROR
Bundle symbolic name is not the same as defined by the deployment package
manifest.
|
static int |
CODE_BUNDLE_SHARING_VIOLATION
Bundle with the same symbolic name already exists.
|
static int |
CODE_CANCELLED
DeploymentAdmin.installDeploymentPackage(InputStream) ,
DeploymentPackage.uninstall() and
DeploymentPackage.uninstallForced() methods can throw
DeploymentException with this error code if the
DeploymentAdmin.cancel() method is called from another thread. |
static int |
CODE_COMMIT_ERROR
Exception with this error code is thrown when one of the Resource
Processors involved in the deployment session threw a
ResourceProcessorException with the
CODE_PREPARE error code. |
static int |
CODE_FOREIGN_CUSTOMIZER
Matched resource processor service is a customizer from another
deployment package.
|
static int |
CODE_MISSING_BUNDLE
A bundle in the deployment package is marked as DeploymentPackage-Missing
but there is no such bundle in the target deployment package.
|
static int |
CODE_MISSING_FIXPACK_TARGET
Fix pack version range doesn't fit to the version of the target
deployment package or the target deployment package of the fix pack
doesn't exist.
|
static int |
CODE_MISSING_HEADER
Missing mandatory manifest header.
|
static int |
CODE_MISSING_RESOURCE
A resource in the source deployment package is marked as
DeploymentPackage-Missing but there is no such resource in the target
deployment package.
|
static int |
CODE_NOT_A_JAR
DeploymentAdmin.installDeploymentPackage(InputStream) methods can
throw DeploymentException with this error code if the got
InputStream is not a jar. |
static int |
CODE_ORDER_ERROR
Order of files in the deployment package is bad.
|
static int |
CODE_OTHER_ERROR
Other error condition.
|
static int |
CODE_PROCESSOR_NOT_FOUND
The Resource Processor service with the given PID (see
Resource-Processor manifest header) is not found. |
static int |
CODE_RESOURCE_SHARING_VIOLATION
An artifact of any resource already exists.
|
static int |
CODE_SIGNING_ERROR
Bad deployment package signing.
|
static int |
CODE_TIMEOUT
When a client requests a new session with an install or uninstall
operation, it must block that call until the earlier session is
completed.
|
Constructor and Description |
---|
DeploymentException(int code)
Create an instance of the exception.
|
DeploymentException(int code,
String message)
Create an instance of the exception.
|
DeploymentException(int code,
String message,
Throwable cause)
Create an instance of the exception.
|
Modifier and Type | Method and Description |
---|---|
Throwable |
getCause()
Returns the cause of this exception or
null if no cause was set. |
int |
getCode() |
Throwable |
initCause(Throwable cause)
Initializes the cause of this exception to the specified value.
|
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final int CODE_CANCELLED
DeploymentAdmin.installDeploymentPackage(InputStream)
,
DeploymentPackage.uninstall()
and
DeploymentPackage.uninstallForced()
methods can throw
DeploymentException
with this error code if the
DeploymentAdmin.cancel()
method is called from another thread.public static final int CODE_NOT_A_JAR
DeploymentAdmin.installDeploymentPackage(InputStream)
methods can
throw DeploymentException
with this error code if the got
InputStream is not a jar.public static final int CODE_ORDER_ERROR
DeploymentAdmin.installDeploymentPackage(InputStream)
throws
exception with this error code.public static final int CODE_MISSING_HEADER
DeploymentAdmin.installDeploymentPackage(InputStream)
can throw
exception with this error code.
public static final int CODE_BAD_HEADER
DeploymentAdmin.installDeploymentPackage(InputStream)
throws
exception with this error code.
public static final int CODE_MISSING_FIXPACK_TARGET
DeploymentAdmin.installDeploymentPackage(InputStream)
throws
exception with this error code.
public static final int CODE_MISSING_BUNDLE
DeploymentAdmin.installDeploymentPackage(InputStream)
throws
exception with this error code.
public static final int CODE_MISSING_RESOURCE
DeploymentAdmin.installDeploymentPackage(InputStream)
throws
exception with this error code.
public static final int CODE_SIGNING_ERROR
DeploymentAdmin.installDeploymentPackage(InputStream)
throws
exception with this error code.
public static final int CODE_BUNDLE_NAME_ERROR
DeploymentAdmin.installDeploymentPackage(InputStream)
throws
exception with this error code.
public static final int CODE_FOREIGN_CUSTOMIZER
DeploymentAdmin.installDeploymentPackage(InputStream)
throws
exception with this error code.
public static final int CODE_BUNDLE_SHARING_VIOLATION
DeploymentAdmin.installDeploymentPackage(InputStream)
throws
exception with this error code.
public static final int CODE_RESOURCE_SHARING_VIOLATION
This exception is thrown when the called resource processor throws a
ResourceProcessorException
with the
CODE_RESOURCE_SHARING_VIOLATION
error code.
DeploymentAdmin.installDeploymentPackage(InputStream)
throws
exception with this error code.
public static final int CODE_COMMIT_ERROR
ResourceProcessorException
with the
CODE_PREPARE
error code.
DeploymentAdmin.installDeploymentPackage(InputStream)
and
DeploymentPackage.uninstall()
methods throw exception with this
error code.
public static final int CODE_OTHER_ERROR
All Deployment Admin methods which throw DeploymentException
can
throw an exception with this error code if the error condition cannot be
categorized.
public static final int CODE_PROCESSOR_NOT_FOUND
Resource-Processor
manifest header) is not found.
DeploymentAdmin.installDeploymentPackage(InputStream)
,
DeploymentPackage.uninstall()
and
DeploymentPackage.uninstallForced()
throws exception with this
error code.
public static final int CODE_TIMEOUT
DeploymentAdmin.installDeploymentPackage(InputStream)
,
DeploymentPackage.uninstall()
and
DeploymentPackage.uninstallForced()
throws exception with this
error code.
public DeploymentException(int code, String message, Throwable cause)
code
- The error code of the failure. Code should be one of the
predefined integer values (CODE_X
).message
- Message associated with the exceptioncause
- the originating exceptionpublic DeploymentException(int code, String message)
code
- The error code of the failure. Code should be one of the
predefined integer values (CODE_X
).message
- Message associated with the exceptionpublic DeploymentException(int code)
code
- The error code of the failure. Code should be one of the
predefined integer values (CODE_X
).public Throwable getCause()
null
if no cause was set.public Throwable initCause(Throwable cause)
initCause
in class Throwable
cause
- The cause of this exception.IllegalArgumentException
- If the specified cause is this
exception.IllegalStateException
- If the cause of this exception has already
been set.public int getCode()
Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0