public class BundleException extends Exception
A BundleException
object is created by the Framework to denote
an exception condition in the lifecycle of a bundle.
BundleException
s should not be created by bundle developers.
A type code is used to identify the exception type for future extendability.
OSGi Alliance reserves the right to extend the set of types.
This exception conforms to the general purpose exception chaining mechanism.
Modifier and Type | Field and Description |
---|---|
static int |
ACTIVATOR_ERROR
The bundle activator was in error.
|
static int |
DUPLICATE_BUNDLE_ERROR
The install or update operation failed because another
already installed bundle has the same symbolic name and version.
|
static int |
INVALID_OPERATION
The operation was invalid.
|
static int |
MANIFEST_ERROR
The bundle manifest was in error.
|
static int |
NATIVECODE_ERROR
The bundle could not be resolved due to an error with the
Bundle-NativeCode header.
|
static int |
RESOLVE_ERROR
The bundle was not resolved.
|
static int |
SECURITY_ERROR
The operation failed due to insufficient permissions.
|
static int |
START_TRANSIENT_ERROR
The start transient operation failed because the start level of the
bundle is greater than the current framework start level
|
static int |
STATECHANGE_ERROR
The operation failed to complete the requested lifecycle state change.
|
static int |
UNSPECIFIED
No exception type is unspecified.
|
static int |
UNSUPPORTED_OPERATION
The operation was unsupported.
|
Constructor and Description |
---|
BundleException(String msg)
Creates a
BundleException with the specified message. |
BundleException(String msg,
int type)
Creates a
BundleException with the specified message and
type. |
BundleException(String msg,
int type,
Throwable cause)
Creates a
BundleException with the specified message, type
and exception cause. |
BundleException(String msg,
Throwable cause)
Creates a
BundleException with the specified message and
exception cause. |
Modifier and Type | Method and Description |
---|---|
Throwable |
getCause()
Returns the cause of this exception or
null if no cause was
set. |
Throwable |
getNestedException()
Returns the cause of this exception or
null if no cause was
specified when this exception was created. |
int |
getType()
Returns the type for this exception or
UNSPECIFIED if the
type was unspecified or unknown. |
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 UNSPECIFIED
public static final int UNSUPPORTED_OPERATION
public static final int INVALID_OPERATION
public static final int MANIFEST_ERROR
public static final int RESOLVE_ERROR
public static final int ACTIVATOR_ERROR
public static final int SECURITY_ERROR
public static final int STATECHANGE_ERROR
public static final int NATIVECODE_ERROR
public static final int DUPLICATE_BUNDLE_ERROR
public static final int START_TRANSIENT_ERROR
public BundleException(String msg, Throwable cause)
BundleException
with the specified message and
exception cause.msg
- The associated message.cause
- The cause of this exception.public BundleException(String msg)
BundleException
with the specified message.msg
- The message.public BundleException(String msg, int type, Throwable cause)
BundleException
with the specified message, type
and exception cause.msg
- The associated message.type
- The type for this exception.cause
- The cause of this exception.public BundleException(String msg, int type)
BundleException
with the specified message and
type.msg
- The message.type
- The type for this exception.public Throwable getNestedException()
null
if no cause was
specified when this exception was created.
This method predates the general purpose exception chaining mechanism.
The getCause()
method is now the preferred means of
obtaining this information.
getCause()
.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 getType()
UNSPECIFIED
if the
type was unspecified or unknown.Copyright © 2018 JBoss by Red Hat. All rights reserved.