类 BundleException

  • 所有已实现的接口:
    java.io.Serializable

    public class BundleException
    extends java.lang.Exception
    A Framework exception used to indicate that a bundle lifecycle problem occurred.

    A BundleException object is created by the Framework to denote an exception condition in the lifecycle of a bundle. BundleExceptions 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.

    作者:
    $Id: a0d23c4cb73b0d6386bcd6b9eebed29fdd9a4deb $
    另请参阅:
    序列化表格
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      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 READ_ERROR
      The framework received an error while reading the input stream for a bundle.
      static int REJECTED_BY_HOOK
      A framework hook rejected the operation.
      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 specified.
      static int UNSUPPORTED_OPERATION
      The operation was unsupported.
    • 构造器概要

      构造器 
      构造器 说明
      BundleException​(java.lang.String msg)
      Creates a BundleException with the specified message.
      BundleException​(java.lang.String msg, int type)
      Creates a BundleException with the specified message and type.
      BundleException​(java.lang.String msg, int type, java.lang.Throwable cause)
      Creates a BundleException with the specified message, type and exception cause.
      BundleException​(java.lang.String msg, java.lang.Throwable cause)
      Creates a BundleException with the specified message and exception cause.
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      java.lang.Throwable getCause()
      Returns the cause of this exception or null if no cause was set.
      java.lang.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.
      java.lang.Throwable initCause​(java.lang.Throwable cause)
      Initializes the cause of this exception to the specified value.
      • 从类继承的方法 java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 字段详细资料

      • UNSPECIFIED

        public static final int UNSPECIFIED
        No exception type is specified.
        从以下版本开始:
        1.5
        另请参阅:
        常量字段值
      • UNSUPPORTED_OPERATION

        public static final int UNSUPPORTED_OPERATION
        The operation was unsupported. This type can be used anywhere a BundleException can be thrown.
        从以下版本开始:
        1.5
        另请参阅:
        常量字段值
      • INVALID_OPERATION

        public static final int INVALID_OPERATION
        The operation was invalid.
        从以下版本开始:
        1.5
        另请参阅:
        常量字段值
      • MANIFEST_ERROR

        public static final int MANIFEST_ERROR
        The bundle manifest was in error.
        从以下版本开始:
        1.5
        另请参阅:
        常量字段值
      • RESOLVE_ERROR

        public static final int RESOLVE_ERROR
        The bundle was not resolved.
        从以下版本开始:
        1.5
        另请参阅:
        常量字段值
      • ACTIVATOR_ERROR

        public static final int ACTIVATOR_ERROR
        The bundle activator was in error.
        从以下版本开始:
        1.5
        另请参阅:
        常量字段值
      • SECURITY_ERROR

        public static final int SECURITY_ERROR
        The operation failed due to insufficient permissions.
        从以下版本开始:
        1.5
        另请参阅:
        常量字段值
      • STATECHANGE_ERROR

        public static final int STATECHANGE_ERROR
        The operation failed to complete the requested lifecycle state change.
        从以下版本开始:
        1.5
        另请参阅:
        常量字段值
      • NATIVECODE_ERROR

        public static final int NATIVECODE_ERROR
        The bundle could not be resolved due to an error with the Bundle-NativeCode header.
        从以下版本开始:
        1.5
        另请参阅:
        常量字段值
      • DUPLICATE_BUNDLE_ERROR

        public static final int DUPLICATE_BUNDLE_ERROR
        The install or update operation failed because another already installed bundle has the same symbolic name and version. This exception type will only occur if the framework is configured to only allow a single bundle to be installed for a given symbolic name and version.
        从以下版本开始:
        1.5
        另请参阅:
        Constants.FRAMEWORK_BSNVERSION, 常量字段值
      • START_TRANSIENT_ERROR

        public static final int START_TRANSIENT_ERROR
        The start transient operation failed because the start level of the bundle is greater than the current framework start level
        从以下版本开始:
        1.5
        另请参阅:
        常量字段值
      • READ_ERROR

        public static final int READ_ERROR
        The framework received an error while reading the input stream for a bundle.
        从以下版本开始:
        1.6
        另请参阅:
        常量字段值
      • REJECTED_BY_HOOK

        public static final int REJECTED_BY_HOOK
        A framework hook rejected the operation.
        从以下版本开始:
        1.6
        另请参阅:
        常量字段值
    • 构造器详细资料

      • BundleException

        public BundleException​(java.lang.String msg,
                               java.lang.Throwable cause)
        Creates a BundleException with the specified message and exception cause.
        参数:
        msg - The associated message.
        cause - The cause of this exception.
      • BundleException

        public BundleException​(java.lang.String msg)
        Creates a BundleException with the specified message.
        参数:
        msg - The message.
      • BundleException

        public BundleException​(java.lang.String msg,
                               int type,
                               java.lang.Throwable cause)
        Creates a 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.
        从以下版本开始:
        1.5
      • BundleException

        public BundleException​(java.lang.String msg,
                               int type)
        Creates a BundleException with the specified message and type.
        参数:
        msg - The message.
        type - The type for this exception.
        从以下版本开始:
        1.5
    • 方法详细资料

      • getNestedException

        public java.lang.Throwable getNestedException()
        Returns the cause of this exception or 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.

        返回:
        The result of calling getCause().
      • getCause

        public java.lang.Throwable getCause()
        Returns the cause of this exception or null if no cause was set.
        覆盖:
        getCause 在类中 java.lang.Throwable
        返回:
        The cause of this exception or null if no cause was set.
        从以下版本开始:
        1.3
      • initCause

        public java.lang.Throwable initCause​(java.lang.Throwable cause)
        Initializes the cause of this exception to the specified value.
        覆盖:
        initCause 在类中 java.lang.Throwable
        参数:
        cause - The cause of this exception.
        返回:
        This exception.
        抛出:
        java.lang.IllegalArgumentException - If the specified cause is this exception.
        java.lang.IllegalStateException - If the cause of this exception has already been set.
        从以下版本开始:
        1.3
      • getType

        public int getType()
        Returns the type for this exception or UNSPECIFIED if the type was unspecified or unknown.
        返回:
        The type of this exception.
        从以下版本开始:
        1.5