]> gerrit.simantics Code Review - simantics/platform.git/blob - server/state/StateSessionManager.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / server / state / StateSessionManager.java
1 package org.simantics.document.server.state;
2
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.exception.DatabaseException;
5 import org.simantics.simulator.toolkit.StandardRealm;
6 import org.simantics.simulator.toolkit.db.StandardVariableSessionManager;
7
8 public class StateSessionManager extends StandardVariableSessionManager<StateNode, StateNodeManagerSupport> {
9
10         private static StateSessionManager INSTANCE;
11
12         public static StateSessionManager getInstance() {
13                 if(INSTANCE == null) {
14                         INSTANCE = new StateSessionManager();
15                 }
16                 return INSTANCE;
17         }
18
19         @Override
20         protected StateNodeManagerSupport createEngine(ReadGraph graph, String id) throws DatabaseException {
21                 return new StateNodeManagerSupport();
22         }
23
24         @Override
25         protected StandardRealm<StateNode, StateNodeManagerSupport> createRealm(StateNodeManagerSupport engine, String id) {
26                 return new StateRealm(engine, id);
27         }
28
29 }