]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java
General event listening interface for DB and purge events.
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / SessionImplSocket.java
index 9290ac99fdd98a5792a542a0b51b7309941f1704..3f4d320ba87c590136995c4ba7b7b9124353ff43 100644 (file)
@@ -136,6 +136,7 @@ import org.simantics.db.service.ClusteringSupport;
 import org.simantics.db.service.CollectionSupport;
 import org.simantics.db.service.DebugSupport;
 import org.simantics.db.service.DirectQuerySupport;
+import org.simantics.db.service.EventSupport;
 import org.simantics.db.service.GraphChangeListenerSupport;
 import org.simantics.db.service.InitSupport;
 import org.simantics.db.service.LifecycleSupport;
@@ -282,6 +283,7 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
         serviceLocator.registerService(ExternalValueSupport.class, new ExternalValueSupportImpl(this));
         serviceLocator.registerService(RandomAccessValueSupport.class, new RandomAccessValueSupportImpl());
         serviceLocator.registerService(ServiceActivityMonitor.class, new ServiceActivityMonitorImpl());
+        serviceLocator.registerService(EventSupport.class, new EventSupportImpl());
         ServiceActivityUpdaterForWriteTransactions.register(this);
 
         this.virtualGraphServerSupport = new VirtualGraphServerSupportImpl(this, t);
@@ -1022,15 +1024,13 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
                        try {
 
                                int sResourceKey = ClusterTraits.getResourceIndexFromResourceKey(s);
-                               int pResourceKey = ClusterTraits.getResourceIndexFromResourceKey(p);
-                               int oResourceKey = ClusterTraits.getResourceIndexFromResourceKey(o);
 
                                ClusterI pc = clusterTable.getClusterProxyByResourceKey(p);
                                ClusterI oc = clusterTable.getClusterProxyByResourceKey(o);
 
                                clusterTranslator.addStatementIndex(cluster, sResourceKey, cluster.getClusterUID(), ClusterChange.REMOVE_OPERATION);
-                               clusterTranslator.addStatementIndex(cluster, pResourceKey, pc.getClusterUID(), ClusterStream.NULL_OPERATION);
-                               clusterTranslator.addStatementIndex(cluster, oResourceKey, oc.getClusterUID(), ClusterStream.NULL_OPERATION);
+                               clusterTranslator.addStatementIndex(cluster, p, pc.getClusterUID(), ClusterStream.NULL_OPERATION);
+                               clusterTranslator.addStatementIndex(cluster, o, oc.getClusterUID(), ClusterStream.NULL_OPERATION);
                                clusterTranslator.removeStatement(cluster);
 
                                queryProvider2.invalidateResource(s);