]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/adapter/GenericRelationIndex.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / adapter / GenericRelationIndex.java
index 7baf2456442d52f7ab9792842d86c372a56cd7ce..c6041445acf1325918d55b74265aed5d598b0ac6 100644 (file)
@@ -1,57 +1,57 @@
-/*******************************************************************************\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.layer0.adapter;\r
-\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.simantics.db.RequestProcessor;\r
-import org.simantics.db.Resource;\r
-\r
-public interface GenericRelationIndex {\r
-\r
-    /*\r
-     * Returns indexed results based on this relation with given constants that\r
-     * fulfill the specified search string.\r
-     */\r
-    List<Map<String, Object>> query(RequestProcessor session, String search, String bindingPattern, Object[] constants, int maxResultCount);\r
-    List<Resource> queryResources(RequestProcessor session, String search, String bindingPattern, Object[] constants, int maxResultCount);\r
-\r
-    /*\r
-     * Returns indexed results based on this relation with given constants.\r
-     * \r
-     * TODO: index listing is not useful like this for large indices. It needs\r
-     * support for listing the contents in a piecewise fashion, iterating\r
-     * through the complete index in slices.\r
-     */\r
-    List<Map<String, Object>> list(RequestProcessor session, String bindingPattern, Object[] constants, int maxResultCount);\r
-\r
-    /*\r
-     * Starts to track changes in this relation. Updates an index using the\r
-     * IndexedRelations service.\r
-     */\r
-    void trackAndIndex(RequestProcessor processor, Resource input);\r
-    void untrack(RequestProcessor processor, Resource input);\r
-\r
-    /*\r
-     * Rebuilds this index\r
-     */\r
-    void reset(RequestProcessor processor, Resource input);\r
-    \r
-    /*\r
-     * The observer is fired whenever changes to the relation are observed. This\r
-     * is applicable only after trackAndIndex has been called.\r
-     */\r
-    void addListener(RequestProcessor processor, Resource model, Runnable observer);\r
-    void removeListener(RequestProcessor processor, Resource model, Runnable observer);\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.layer0.adapter;
+
+import java.util.List;
+import java.util.Map;
+
+import org.simantics.db.RequestProcessor;
+import org.simantics.db.Resource;
+
+public interface GenericRelationIndex {
+
+    /*
+     * Returns indexed results based on this relation with given constants that
+     * fulfill the specified search string.
+     */
+    List<Map<String, Object>> query(RequestProcessor session, String search, String bindingPattern, Object[] constants, int maxResultCount);
+    List<Resource> queryResources(RequestProcessor session, String search, String bindingPattern, Object[] constants, int maxResultCount);
+
+    /*
+     * Returns indexed results based on this relation with given constants.
+     * 
+     * TODO: index listing is not useful like this for large indices. It needs
+     * support for listing the contents in a piecewise fashion, iterating
+     * through the complete index in slices.
+     */
+    List<Map<String, Object>> list(RequestProcessor session, String bindingPattern, Object[] constants, int maxResultCount);
+
+    /*
+     * Starts to track changes in this relation. Updates an index using the
+     * IndexedRelations service.
+     */
+    void trackAndIndex(RequestProcessor processor, Resource input);
+    void untrack(RequestProcessor processor, Resource input);
+
+    /*
+     * Rebuilds this index
+     */
+    void reset(RequestProcessor processor, Resource input);
+    
+    /*
+     * The observer is fired whenever changes to the relation are observed. This
+     * is applicable only after trackAndIndex has been called.
+     */
+    void addListener(RequestProcessor processor, Resource model, Runnable observer);
+    void removeListener(RequestProcessor processor, Resource model, Runnable observer);
+
+}