From 7690cb21d051728c5b72a99a2c1cc50f8e907f8e Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Sat, 14 Mar 2015 00:48:34 +0000
Subject: [PATCH] OPENDJ-1848: simplify DatabaseContainer and Storage APIs

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DatabaseContainer.java |   34 ++--------------------------------
 1 files changed, 2 insertions(+), 32 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DatabaseContainer.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DatabaseContainer.java
index 029ae64..dacfb17 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DatabaseContainer.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DatabaseContainer.java
@@ -26,11 +26,8 @@
  */
 package org.opends.server.backends.pluggable;
 
-import java.io.Closeable;
-
 import org.opends.server.backends.pluggable.spi.Cursor;
 import org.opends.server.backends.pluggable.spi.ReadableStorage;
-import org.opends.server.backends.pluggable.spi.Storage;
 import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
 import org.opends.server.backends.pluggable.spi.TreeName;
 import org.opends.server.backends.pluggable.spi.WriteableStorage;
@@ -39,23 +36,18 @@
  * This class is a wrapper around the JE database object and provides basic
  * read and write methods for entries.
  */
-abstract class DatabaseContainer implements Closeable
+abstract class DatabaseContainer
 {
   /** The name of the database within the entryContainer. */
   private TreeName name;
 
-  /** The reference to the JE Storage. */
-  final Storage storage;
-
   /**
    * Create a new DatabaseContainer object.
    *
    * @param treeName The name of the entry database.
-   * @param storage The JE Storage.
    */
-  DatabaseContainer(TreeName treeName, Storage storage)
+  DatabaseContainer(TreeName treeName)
   {
-    this.storage = storage;
     this.name = treeName;
   }
 
@@ -75,28 +67,6 @@
   }
 
   /**
-   * Flush any cached database information to disk and close the
-   * database container.
-   *
-   * The database container should not be closed while other processes
-   * 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 committed or aborted.
-   *
-   * The container may not be accessed again after this method is
-   * called, regardless of the method's success or failure.
-   *
-   * @throws StorageRuntimeException if an error occurs.
-   */
-  @Override
-  public synchronized void close() throws StorageRuntimeException
-  {
-    // FIXME: is this method needed?
-    storage.closeTree(name);
-  }
-
-  /**
    * Get the count of key/data pairs in the database in a JE database.
    * This is a simple wrapper around the JE Database.count method.
    * @param txn The JE transaction handle, or null if none.

--
Gitblit v1.10.0