if (!canWrite() || stateManager.getCachedTimeStamp() == stateManager.getSystemState().getTimeStamp()) return; try { File stateTmpFile = File.createTempFile(LocationManager.STATE_FILE, ".new", LocationManager.getOSGiConfigurationDir()); File lazyTmpFile = File.createTempFile(LocationManager.LAZY_FILE, ".new", LocationManager.getOSGiConfigurationDir()); stateManager.shutdown(stateTmpFile, lazyTmpFile); fileManager.lookup(LocationManager.STATE_FILE, true); fileManager.lookup(LocationManager.LAZY_FILE, true); fileManager.update(new String[] {LocationManager.STATE_FILE, LocationManager.LAZY_FILE}, new String[] {stateTmpFile.getName(), lazyTmpFile.getName()}); } catch (IOException e) { frameworkLog.log(new FrameworkEvent(FrameworkEvent.ERROR, context.getBundle(), e)); }
if (stateSaver != null) stateSaver.shutdown(); saveStateToFile(true);
	public void shutdownStateManager() {		if (!canWrite() || stateManager.getCachedTimeStamp() == stateManager.getSystemState().getTimeStamp())			return;		try {			File stateTmpFile = File.createTempFile(LocationManager.STATE_FILE, ".new", LocationManager.getOSGiConfigurationDir()); //$NON-NLS-1$			File lazyTmpFile = File.createTempFile(LocationManager.LAZY_FILE, ".new", LocationManager.getOSGiConfigurationDir()); //$NON-NLS-1$			stateManager.shutdown(stateTmpFile, lazyTmpFile);			fileManager.lookup(LocationManager.STATE_FILE, true);			fileManager.lookup(LocationManager.LAZY_FILE, true);			fileManager.update(new String[] {LocationManager.STATE_FILE, LocationManager.LAZY_FILE}, new String[] {stateTmpFile.getName(), lazyTmpFile.getName()});		} catch (IOException e) {			frameworkLog.log(new FrameworkEvent(FrameworkEvent.ERROR, context.getBundle(), e));		}	}