From 3ab9614db1a1a1a30c271424c4189999bf71b87a Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 07 Mar 2014 10:58:03 +0000
Subject: [PATCH] OPENDJ-1308 Migrate schema support

---
 opendj3-server-dev/src/server/org/opends/server/backends/jeb/DatabaseContainer.java |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/backends/jeb/DatabaseContainer.java b/opendj3-server-dev/src/server/org/opends/server/backends/jeb/DatabaseContainer.java
index a4f58c4..7e39a52 100644
--- a/opendj3-server-dev/src/server/org/opends/server/backends/jeb/DatabaseContainer.java
+++ b/opendj3-server-dev/src/server/org/opends/server/backends/jeb/DatabaseContainer.java
@@ -26,17 +26,19 @@
  */
 package org.opends.server.backends.jeb;
 
-import com.sleepycat.je.*;
+import java.io.Closeable;
 
 import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.opends.server.util.ServerConstants;
 import org.opends.server.util.StaticUtils;
 
+import com.sleepycat.je.*;
+
 /**
  * This class is a wrapper around the JE database object and provides basic
  * read and write methods for entries.
  */
-public abstract class DatabaseContainer
+public abstract class DatabaseContainer implements Closeable
 {
   private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
 
@@ -89,7 +91,7 @@
    * created and used to perform the open.
    *
    * @throws DatabaseException if a JE database error occurs while
-   * openning the index.
+   * opening the index.
    */
   public void open() throws DatabaseException
   {
@@ -131,17 +133,18 @@
    * database container.
    *
    * The database container should not be closed while other processes
-   * aquired the container. The container should not be closed
+   * acquired the container. The container should not be closed
    * while cursors handles into the database remain open, or
    * transactions that include operations on the database have not yet
-   * been commited or aborted.
+   * been committed or aborted.
    *
    * The container may not be accessed again after this method is
    * called, regardless of the method's success or failure.
    *
    * @throws DatabaseException if an error occurs.
    */
-  synchronized void close() throws DatabaseException
+  @Override
+  synchronized public void close() throws DatabaseException
   {
     if(dbConfig.getDeferredWrite())
     {
@@ -270,7 +273,6 @@
       throws DatabaseException
   {
     return database.openCursor(cursorConfig);
-
   }
 
   /**
@@ -293,6 +295,7 @@
    * Get a string representation of this object.
    * @return return A string representation of this object.
    */
+  @Override
   public String toString()
   {
     return name;
@@ -338,7 +341,7 @@
   {
     StringBuilder builder = new StringBuilder();
     builder.append(" (");
-    builder.append(status.toString());
+    builder.append(status);
     builder.append(")");
     builder.append(" db=");
     try
@@ -347,7 +350,7 @@
     }
     catch (DatabaseException de)
     {
-      builder.append(de.toString());
+      builder.append(de);
     }
     if (txn != null)
     {
@@ -358,7 +361,7 @@
       }
       catch (DatabaseException de)
       {
-        builder.append(de.toString());
+        builder.append(de);
       }
     }
     else
@@ -387,5 +390,4 @@
     return builder.toString();
   }
 
-
 }

--
Gitblit v1.10.0