-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.db.impl.query;\r
-\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.impl.graph.ReadGraphImpl;\r
-\r
-\r
-\r
-public abstract class CacheEntry {\r
- \r
- final public static int HAS_BEEN_BOUND = 1;\r
-\r
- abstract boolean isFresh();\r
- abstract boolean isReady();\r
- abstract boolean isRefuted();\r
- abstract boolean isPending();\r
- abstract boolean isDiscarded();\r
- abstract boolean isExcepted();\r
-\r
- abstract void setReady();\r
- abstract void refute();\r
- abstract void setPending();\r
- abstract void discard();\r
- abstract void except(Throwable t);\r
- abstract void setResult(Object result);\r
- abstract void clearResult(QuerySupport support);\r
-\r
- abstract void prepareRecompute(QuerySupport querySupport);\r
- \r
- abstract public Object getOriginalRequest();\r
- abstract Query getQuery();\r
- abstract <T> T getResult();\r
-\r
- abstract CacheEntry pruneFirstParents();\r
- abstract void removeParent(CacheEntry entry);\r
- abstract void addParent(CacheEntry entry);\r
- abstract boolean hasParents();\r
- abstract Iterable<CacheEntry> getParents(QueryProcessor processor);\r
- abstract CacheEntry getFirstParent(QueryProcessor processor);\r
- abstract boolean moreThanOneParent(QueryProcessor processor);\r
- abstract int parentCount(QueryProcessor processor);\r
- \r
- abstract void performFromCache(ReadGraphImpl graph, Object provider, Object procedure);\r
- \r
- abstract boolean isImmutable(ReadGraphImpl graph) throws DatabaseException;\r
- \r
- abstract boolean shouldBeCollected();\r
- \r
- abstract short getLevel();\r
- abstract short setLevel(short level);\r
- \r
- abstract int getGCStatus();\r
- abstract int setGCStatus(int status);\r
- abstract void setGCStatusFlag(int flag, boolean value);\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.db.impl.query;
+
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.impl.graph.ReadGraphImpl;
+
+
+
+public abstract class CacheEntry<Procedure> {
+
+ final public static int HAS_BEEN_BOUND = 1;
+
+ abstract boolean isFresh();
+ abstract boolean isReady();
+ abstract boolean isRefuted();
+ abstract boolean isPending();
+ abstract boolean isDiscarded();
+ abstract boolean isExcepted();
+
+ abstract void setReady();
+ abstract void refute();
+ abstract void setPending(QuerySupport querySupport);
+ abstract void discard();
+ abstract void except(Throwable t);
+ abstract void clearResult(QuerySupport support);
+
+ abstract void prepareRecompute(QuerySupport querySupport);
+
+ abstract public Object getOriginalRequest();
+ abstract Query getQuery();
+
+ abstract CacheEntry pruneFirstParents();
+ abstract void removeParent(CacheEntry entry);
+ abstract void addParent(CacheEntry entry);
+ abstract boolean hasParents();
+ abstract Iterable<CacheEntry<?>> getParents(QueryProcessor processor);
+ abstract CacheEntry getFirstParent(QueryProcessor processor);
+ abstract boolean moreThanOneParent(QueryProcessor processor);
+ abstract int parentCount(QueryProcessor processor);
+
+ 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;
+
+ abstract boolean shouldBeCollected();
+
+ abstract short getLevel();
+ abstract short setLevel(short level);
+
+ abstract int getGCStatus();
+ abstract int setGCStatus(int status);
+ abstract void setGCStatusFlag(int flag, boolean value);
+
+}