]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.acorn/src/org/simantics/acorn/GraphClientImpl2.java
Fixing problems in the database unit testing environment with Acorn
[simantics/platform.git] / bundles / org.simantics.acorn / src / org / simantics / acorn / GraphClientImpl2.java
index 7a57053bcf6aa9f1af09548424bfe00c59456751..2ffdc715ff2546db5e03e67e102858a2317b87ef 100644 (file)
@@ -68,6 +68,7 @@ public class GraphClientImpl2 implements Database.Session {
        private Path dbFolder;
        private final Database database;
        private ServiceLocator locator;
+       private FileCache fileCache;
        private MainProgram mainProgram;
 
        private static class ClientThreadFactory implements ThreadFactory {
@@ -92,7 +93,10 @@ public class GraphClientImpl2 implements Database.Session {
            this.database = database;
            this.dbFolder = dbFolder;
            this.locator = locator;
-           this.clusters = new ClusterManager(dbFolder);
+           this.fileCache = new FileCache();
+           // This disposes the cache when the session is shut down 
+           locator.registerService(FileCache.class, fileCache);
+           this.clusters = new ClusterManager(dbFolder, fileCache);
            load();
            ClusterSetsSupport cssi = locator.getService(ClusterSetsSupport.class);
            cssi.setReadDirectory(clusters.lastSessionDirectory);