Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / derby-10.3.2.1 / java / engine / org / apache / derby / impl / store / raw / xact / D_Xact.java
diff --git a/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/impl/store/raw/xact/D_Xact.java b/JMCR-Stable/real-world application/derby-10.3.2.1/java/engine/org/apache/derby/impl/store/raw/xact/D_Xact.java
new file mode 100644 (file)
index 0000000..c2f7b7c
--- /dev/null
@@ -0,0 +1,64 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.impl.store.raw.xact.D_Xact\r
+\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to you under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.impl.store.raw.xact;\r
+\r
+import org.apache.derby.iapi.services.diag.Diagnosticable;\r
+import org.apache.derby.iapi.services.diag.DiagnosticableGeneric;\r
+import org.apache.derby.iapi.services.diag.DiagnosticUtil;\r
+import org.apache.derby.iapi.store.raw.xact.TransactionId;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+/**\r
+\r
+The D_Xact class provides diagnostic information about the Xact class.\r
+\r
+**/\r
+\r
+public class D_Xact extends DiagnosticableGeneric\r
+{\r
+\r
+    /**\r
+     * Default implementation of diagnostic on the object.\r
+     * <p>\r
+     * This routine returns a string with whatever diagnostic information\r
+     * you would like to provide about this object.\r
+     * <p>\r
+     * This routine should be overriden by a real implementation of the\r
+     * diagnostic information you would like to provide.\r
+     * <p>\r
+     *\r
+        * @return A string with diagnostic information about the object.\r
+     * @exception StandardException Standard Derby Error\r
+     *\r
+     **/\r
+    public String diag()\r
+        throws StandardException\r
+    {\r
+        TransactionId id = ((Xact) diag_object).getId();\r
+\r
+        if (id instanceof XactId)\r
+            return("Transaction:(" + ((XactId) id).getId() + ")");\r
+        else\r
+            return(id.toString());\r
+    }\r
+}\r