]> 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 07fe18e61201cc16fd4e62bd62b808d8d6b5041d..20abf68db0e6853ac882b5df5c22dbf638ef6eb7 100644 (file)
@@ -61,6 +61,7 @@ public class GraphClientImpl2 implements Database.Session {
        private Path dbFolder;
        private final Database database;
        private ServiceLocator locator;
+       private FileCache fileCache;
        private MainProgram mainProgram;
 
        static class ClientThreadFactory implements ThreadFactory {
@@ -85,7 +86,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);