The OSGi interface BundleActivator is defined as:
public interface BundleActivator {
public void start(BundleContext context) throws Exception;
public void stop(BundleContext context) throws Exception;
}
The BaseBundleActivator class defined by SAT implements this
interface and provides final implementations of the
start(BundleContext) and stop(BundleContext)
methods.
If an exception occurs while starting or stopping a bundle, SAT catches
the exception and sends the bundle activator the handler hook method
handleException(Exception) that is implemented by the
BaseBundleActivator class as follows:
protected boolean handleException(Exception exception) {
return false;
}
BaseBundleActivator implementation of the
handleException(Exception) method simply returns
false, indicating that the exception was not fully
handled and needs to be thrown by SAT. If the exception is not fully
handled the exception will be re-thrown by the
BaseBundleActivator.
handleException(Exception), returning true to
prevent the exception being re-thrown by SAT.
start(BundleContext) method will roll-back to the
Resolved state. Catching a thrown exception might mean that the
bundle can successfully transition to the Active state.
Copyright © 2001, 2007 IBM Corporation and others. All Rights Reserved.