]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/CacheEntry.java
Multiple reader thread support for db client
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / query / CacheEntry.java
index d65622dadd0a18ecafb1c15b3c7c22b15b345cb0..8489256225da47bfa52c2aa29940ffbba386e24b 100644 (file)
@@ -16,7 +16,7 @@ import org.simantics.db.impl.graph.ReadGraphImpl;
 
 
 
-public abstract class CacheEntry {
+public abstract class CacheEntry<Procedure> {
        
     final public static int HAS_BEEN_BOUND = 1;
 
@@ -32,25 +32,26 @@ public abstract class CacheEntry {
     abstract void setPending();
     abstract void discard();
     abstract void except(Throwable t);
-    abstract void setResult(Object result);
     abstract void clearResult(QuerySupport support);
 
     abstract void prepareRecompute(QuerySupport querySupport);
     
     abstract public Object getOriginalRequest();
     abstract Query getQuery();
-    abstract <T> T getResult();
 
     abstract CacheEntry pruneFirstParents();
     abstract void removeParent(CacheEntry entry);
     abstract void addParent(CacheEntry entry);
     abstract boolean hasParents();
-    abstract Iterable<CacheEntry> getParents(QueryProcessor processor);
+    abstract Iterable<CacheEntry<?>> getParents(QueryProcessor processor);
     abstract CacheEntry getFirstParent(QueryProcessor processor);
     abstract boolean moreThanOneParent(QueryProcessor processor);
     abstract int parentCount(QueryProcessor processor);
     
-    abstract void performFromCache(ReadGraphImpl graph, Object provider, Object procedure);
+    abstract <T> T getResult();
+    abstract void setResult(Object result);
+    
+    abstract Object performFromCache(ReadGraphImpl graph, Procedure procedure) throws DatabaseException;
     
     abstract boolean isImmutable(ReadGraphImpl graph) throws DatabaseException;