if (!registryObjects.isDirty() || cacheFileManager.isReadOnly()) { cacheFileManager.close();
if (!registryObjects.isDirty() || cacheStorageManager.isReadOnly()) { cacheStorageManager.close();
	public void stop(Object key) {		// If the registry creator specified a key token, check that the key mathches it 		// (it is assumed that registry owner keeps the key to prevent unautorized accesss).		if (masterToken != null && masterToken != key) {			throw new IllegalArgumentException("Unauthorized access to the ExtensionRegistry.stop() method. Check if proper access token is supplied."); //$NON-NLS-1$  		}		// Do extra stop processing if specified in the registry strategy		strategy.onStop(this);		stopChangeEventScheduler();		if (cacheFileManager == null)			return;		if (!registryObjects.isDirty() || cacheFileManager.isReadOnly()) {			cacheFileManager.close();			return;		}		File tableFile = null;		File mainFile = null;		File extraFile = null;		File contributionsFile = null;		File orphansFile = null;		TableWriter theTableWriter = new TableWriter(this);		try {			cacheFileManager.lookup(TableReader.TABLE, true);			cacheFileManager.lookup(TableReader.MAIN, true);			cacheFileManager.lookup(TableReader.EXTRA, true);			cacheFileManager.lookup(TableReader.CONTRIBUTIONS, true);			cacheFileManager.lookup(TableReader.ORPHANS, true);			tableFile = File.createTempFile(TableReader.TABLE, ".new", cacheFileManager.getBase()); //$NON-NLS-1$			mainFile = File.createTempFile(TableReader.MAIN, ".new", cacheFileManager.getBase()); //$NON-NLS-1$			extraFile = File.createTempFile(TableReader.EXTRA, ".new", cacheFileManager.getBase()); //$NON-NLS-1$			contributionsFile = File.createTempFile(TableReader.CONTRIBUTIONS, ".new", cacheFileManager.getBase()); //$NON-NLS-1$			orphansFile = File.createTempFile(TableReader.ORPHANS, ".new", cacheFileManager.getBase()); //$NON-NLS-1$			theTableWriter.setTableFile(tableFile);			theTableWriter.setExtraDataFile(extraFile);			theTableWriter.setMainDataFile(mainFile);			theTableWriter.setContributionsFile(contributionsFile);			theTableWriter.setOrphansFile(orphansFile);		} catch (IOException e) {			cacheFileManager.close();			return; //Ignore the exception since we can recompute the cache		}		try {			if (theTableWriter.saveCache(registryObjects, computeTimeStamp()))				cacheFileManager.update(new String[] {TableReader.TABLE, TableReader.MAIN, TableReader.EXTRA, TableReader.CONTRIBUTIONS, TableReader.ORPHANS}, new String[] {tableFile.getName(), mainFile.getName(), extraFile.getName(), contributionsFile.getName(), orphansFile.getName()});		} catch (IOException e) {			//Ignore the exception since we can recompute the cache		}		cacheFileManager.close();		theTableReader.close();	}