public void stop(StopContext context) {
XBundle bundle = injectedBundle.getValue();
try {
// Server shutdown should not modify the persistent start setting
BundleManager bundleManager = depUnit.getAttachment(OSGiConstants.BUNDLE_MANAGER_KEY);
bundleManager.stopBundle(bundle, Bundle.STOP_TRANSIENT);
depUnit.putAttachment(Attachments.BUNDLE_STATE_KEY, BundleState.RESOLVED);
} catch (BundleException ex) {
LOGGER.debugf(ex, "Cannot stop bundle: %s", bundle);
}
}