/** * <p> * Remove all entries from the model cache * </p> */ public void clearCache() { getFileManager().resetCache(); }
/** * <p> * Remove all entries from the model cache * </p> */ public void clearCache() { getFileManager().resetCache(); }
/** * <p>Reset all state in this document manager back to the default * values it would have had when the object was created. Optionally * reload the profile metadata from the search path. <strong>Note</strong> * that the metadata search path is not changed by this reset.</p> * @param reload If true, reload the configuration file from the * search path. */ public void reset( boolean reload ) { // first check if we are using the global file manager, or a local one if (m_usingGlobalFileMgr) { // we can do a general reset by throwing away the old FM and creating a new one setFileManager(); } else { // not using the global default FM, so we reset to best effort getFileManager().resetCache(); } m_ignoreImports.clear(); m_prefixMap = new PrefixMappingImpl(); setDefaults(); if (reload) { initialiseMetadata( m_searchPath ); } }
/** * <p>Reset all state in this document manager back to the default * values it would have had when the object was created. Optionally * reload the profile metadata from the search path. <strong>Note</strong> * that the metadata search path is not changed by this reset.</p> * @param reload If true, reload the configuration file from the * search path. */ public void reset( boolean reload ) { // first check if we are using the global file manager, or a local one if (m_usingGlobalFileMgr) { // we can do a general reset by throwing away the old FM and creating a new one setFileManager(); } else { // not using the global default FM, so we reset to best effort getFileManager().resetCache(); } m_ignoreImports.clear(); m_prefixMap = new PrefixMappingImpl(); setDefaults(); if (reload) { initialiseMetadata( m_searchPath ); } }
public void testCache3() { FileManager fileManager = FileManager.get() ; fileManager.addLocatorFile(testingDir) ; fileManager.setModelCaching(true) ; Model m1 = fileManager.loadModel(fileModel) ; Model m2 = fileManager.loadModel(fileModel) ; assertSame(m1, m2) ; fileManager.removeCacheModel(fileModel) ; Model m3 = fileManager.loadModel(fileModel) ; assertNotSame(m1, m3) ; fileManager.resetCache() ; Model m4 = fileManager.loadModel(fileModel) ; Model m5 = fileManager.loadModel(fileModel) ; assertSame(m4, m5) ; assertNotSame(m1, m4) ; assertNotSame(m3, m4) ; }
@Test public void testCache3() { FileManager fileManager = FileManager.get() ; fileManager.addLocatorFile(testingDir) ; fileManager.setModelCaching(true) ; Model m1 = fileManager.loadModel(fileModel) ; Model m2 = fileManager.loadModel(fileModel) ; assertSame(m1, m2) ; fileManager.removeCacheModel(fileModel) ; Model m3 = fileManager.loadModel(fileModel) ; assertNotSame(m1, m3) ; fileManager.resetCache() ; Model m4 = fileManager.loadModel(fileModel) ; Model m5 = fileManager.loadModel(fileModel) ; assertSame(m4, m5) ; assertNotSame(m1, m4) ; assertNotSame(m3, m4) ; }
public void testCache3() { FileManager fileManager = FileManager.get() ; fileManager.addLocatorFile(testingDir) ; fileManager.setModelCaching(true) ; Model m1 = fileManager.loadModel(fileModel) ; Model m2 = fileManager.loadModel(fileModel) ; assertSame(m1, m2) ; fileManager.removeCacheModel(fileModel) ; Model m3 = fileManager.loadModel(fileModel) ; assertNotSame(m1, m3) ; fileManager.resetCache() ; Model m4 = fileManager.loadModel(fileModel) ; Model m5 = fileManager.loadModel(fileModel) ; assertSame(m4, m5) ; assertNotSame(m1, m4) ; assertNotSame(m3, m4) ; }