stateManager.update(newData.getManifest(),newData.getLocation(),newData.getBundleID());
long bundleId = newData.getBundleID(); State systemState = stateManager.getSystemState(); systemState.removeBundle(bundleId); BundleDescription newDescription = stateManager.getFactory().createBundleDescription(newData.getManifest(), newData.getLocation(),bundleId); systemState.addBundle(newDescription);
			public void commit(boolean postpone) throws BundleException			{				try				{					newData.save();				}				catch (IOException e)				{					throw new BundleException(AdaptorMsg.formatter.getString("ADAPTOR_STORAGE_EXCEPTION"), e);				}				stateManager.update(newData.getManifest(),newData.getLocation(),newData.getBundleID());				File originalGenerationDir = data.getGenerationDir();				if (postpone || !rm(originalGenerationDir))				{					/* mark this bundle to be deleted to ensure it is fully cleaned up					 * on next restart.					 */					File delete = new File(originalGenerationDir, ".delete");					if (!delete.exists())					{						try						{							/* create .delete */							FileOutputStream out = new FileOutputStream(delete);							out.close();						}						catch (IOException e)						{							if (Debug.DEBUG && Debug.DEBUG_GENERAL)							{								Debug.println("Unable to write " + delete.getPath() + ": " + e.getMessage());							}							eventPublisher.publishFrameworkEvent(FrameworkEvent.ERROR, data.getBundle(), e);						}					}				}			}