org.osgi.framework
Class BundleException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.osgi.framework.BundleException
All Implemented Interfaces:
Serializable

public class BundleException
extends Exception

A Framework exception used to indicate that a bundle lifecycle problem occurred.

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.

This exception is updated to conform to the general purpose exception chaining mechanism.

Version:
$Revision: 1.15 $
See Also:
Serialized Form

Constructor Summary
BundleException(String msg)
          Creates a BundleException object with the specified message.
BundleException(String msg, Throwable cause)
          Creates a BundleException that wraps another exception.
 
Method Summary
 Throwable getCause()
          Returns the cause of this exception or null if no cause was specified when this exception was created.
 Throwable getNestedException()
          Returns any nested exceptions included in this exception.
 Throwable initCause(Throwable cause)
          The cause of this exception can only be set when constructed.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BundleException

public BundleException(String msg,
                       Throwable cause)
Creates a BundleException that wraps another exception.

Parameters:
msg - The associated message.
cause - The cause of this exception.

BundleException

public BundleException(String msg)
Creates a BundleException object with the specified message.

Parameters:
msg - The message.
Method Detail

getNestedException

public Throwable getNestedException()
Returns any nested exceptions included in this exception.

This method predates the general purpose exception chaining mechanism. The getCause() method is now the preferred means of obtaining this information.

Returns:
The nested exception; null if there is no nested exception.

getCause

public Throwable getCause()
Returns the cause of this exception or null if no cause was specified when this exception was created.

Overrides:
getCause in class Throwable
Returns:
The cause of this exception or null if no cause was specified.
Since:
1.3

initCause

public Throwable initCause(Throwable cause)
The cause of this exception can only be set when constructed.

Overrides:
initCause in class Throwable
Parameters:
cause - Cause of the exception.
Returns:
This object.
Throws:
IllegalStateException - This method will always throw an IllegalStateException since the cause of this exception can only be set when constructed.
Since:
1.3


Copyright © 2006-2011 OSGi Alliance. All Rights Reserved.