From 7d4afa23f07f3a4471fd5b71ff8e04ae4c928387 Mon Sep 17 00:00:00 2001
From: abobrov <abobrov@localhost>
Date: Thu, 07 Jun 2007 22:33:56 +0000
Subject: [PATCH] this splits initializeEntryCache() method in two, bringing initializeDefaultEntryCache() method that takes the default cache initialization out of initializeEntryCache() method. the default entry cache will be initialized before backends initialization thus resolving issues like NPE via AciListenerManager etc.
---
opends/src/server/org/opends/server/core/EntryCacheConfigManager.java | 65 +++++++++++++++++++-------------
1 files changed, 39 insertions(+), 26 deletions(-)
diff --git a/opends/src/server/org/opends/server/core/EntryCacheConfigManager.java b/opends/src/server/org/opends/server/core/EntryCacheConfigManager.java
index 1f41ead..935ded4 100644
--- a/opends/src/server/org/opends/server/core/EntryCacheConfigManager.java
+++ b/opends/src/server/org/opends/server/core/EntryCacheConfigManager.java
@@ -95,37 +95,15 @@
/**
- * Initializes the configuration associated with the Directory Server entry
- * cache. This should only be called at Directory Server startup. If an
- * error occurs, then a message will be logged and the default entry cache
- * will be installed.
- *
- * @throws ConfigException If a configuration problem causes the entry
- * cache initialization process to fail.
+ * Initializes the default entry cache.
+ * This should only be called at Directory Server startup.
*
* @throws InitializationException If a problem occurs while trying to
* install the default entry cache.
*/
- public void initializeEntryCache()
- throws ConfigException, InitializationException
+ public void initializeDefaultEntryCache()
+ throws InitializationException
{
- // Get the root configuration object.
- ServerManagementContext managementContext =
- ServerManagementContext.getInstance();
- RootCfg rootConfiguration =
- managementContext.getRootConfiguration();
-
- // Register as an add and delete listener with the root configuration so we
- // can be notified if any entry cache entry is added or removed.
- // If entry cache configuration is using a one-to-zero-or-one relation
- // then uncomment the lines below (see issue #1558).
- /*
- // rootConfiguration.addEntryCacheAddListener(this);
- // rootConfiguration.addEntryCacheDeleteListener(this);
- */
-
- // First, install a default entry cache so that there will be one even if
- // we encounter a problem later.
try
{
DefaultEntryCache defaultCache = new DefaultEntryCache();
@@ -145,6 +123,41 @@
throw new InitializationException(msgID, message, e);
}
+ }
+
+
+ /**
+ * Initializes the configuration associated with the Directory Server entry
+ * cache. This should only be called at Directory Server startup. If an
+ * error occurs, then a message will be logged and the default entry cache
+ * will be installed.
+ *
+ * @throws ConfigException If a configuration problem causes the entry
+ * cache initialization process to fail.
+ */
+ public void initializeEntryCache()
+ throws ConfigException
+ {
+ // Get the root configuration object.
+ ServerManagementContext managementContext =
+ ServerManagementContext.getInstance();
+ RootCfg rootConfiguration =
+ managementContext.getRootConfiguration();
+
+ // Default entry cache should be already installed with
+ // <CODE>initializeDefaultEntryCache()</CODE> method so
+ // that there will be one even if we encounter a problem
+ // later.
+
+ // Register as an add and delete listener with the root configuration so we
+ // can be notified if any entry cache entry is added or removed.
+ // If entry cache configuration is using a one-to-zero-or-one relation
+ // then uncomment the lines below (see issue #1558).
+ /*
+ // rootConfiguration.addEntryCacheAddListener(this);
+ // rootConfiguration.addEntryCacheDeleteListener(this);
+ */
+
// If the entry cache configuration is not present then keep the
// default entry cache already installed.
// If entry cache configuration is using a one-to-zero-or-one relation
--
Gitblit v1.10.0