]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/Resource.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / Resource.java
diff --git a/bundles/org.simantics.db/src/org/simantics/db/Resource.java b/bundles/org.simantics.db/src/org/simantics/db/Resource.java
new file mode 100644 (file)
index 0000000..4a38f1b
--- /dev/null
@@ -0,0 +1,49 @@
+/*******************************************************************************\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;\r
+\r
+import org.simantics.utils.Container;\r
+\r
+/**\r
+ * A Graph independent reference to a resource. These can be stored between\r
+ * transactions and later used with any {@link RequestProcessor} or\r
+ * {@link AsyncRequestProcessor} that originates from a Session with the same\r
+ * database.\r
+ * \r
+ * <p>\r
+ * Resources are considered implementation dependent. Therefore\r
+ * <code>Resource</code> instances from different implementations of this\r
+ * database connection API should not be used together.\r
+ * </p>\r
+ * \r
+ * <p>\r
+ * This interface should not be implemented by clients.\r
+ * </p>\r
+ * \r
+ * @author Tuukka Lehtonen\r
+ * @see AsyncReadGraph\r
+ * @see ReadGraph\r
+ * @see WriteGraph\r
+ */\r
+public interface Resource extends Container<Resource>, Comparable<Resource> {\r
+\r
+    Resource[] NONE = new Resource[0];\r
+\r
+    long getResourceId();\r
+    \r
+    int getThreadHash();\r
+    \r
+    boolean isPersistent();\r
+    \r
+    boolean equalsResource(Resource other);\r
+\r
+}\r