From c13f19e5cca8d810c37dc64f7a1f43e3bd4d60fe Mon Sep 17 00:00:00 2001
From: dugan <dugan@localhost>
Date: Tue, 11 Sep 2007 18:59:14 +0000
Subject: [PATCH] Add finalizePlugin method to remove Referential Integrity change listener and stop background thread if needed.
---
opendj-sdk/opends/src/server/org/opends/server/plugins/ReferentialIntegrityPlugin.java | 32 +++++++++++++++++++++++++++++---
1 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/plugins/ReferentialIntegrityPlugin.java b/opendj-sdk/opends/src/server/org/opends/server/plugins/ReferentialIntegrityPlugin.java
index b748629..a0725f7 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/plugins/ReferentialIntegrityPlugin.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/plugins/ReferentialIntegrityPlugin.java
@@ -27,6 +27,7 @@
package org.opends.server.plugins;
import org.opends.server.admin.std.server.ReferentialIntegrityPluginCfg;
+import org.opends.server.admin.std.server.PluginCfg;
import org.opends.server.admin.std.meta.PluginCfgDefn;
import org.opends.server.admin.server.ConfigurationChangeListener;
import org.opends.server.api.plugin.*;
@@ -198,14 +199,28 @@
baseDNs = newConfiguredBaseDNs;
attributeTypes = newAttributeTypes;
long newInterval=newConfiguration.getReferentialIntegrityUpdateInterval();
- //If the interval has changed, process that change. The change might start
- //or stop the background processing thread.
- if(newInterval != interval)
+ //If the plugin is enabled and the interval has changed, process that
+ //change. The change might start or stop the background processing thread.
+ if(newConfiguration.isEnabled() && newInterval != interval)
processIntervalChange(newInterval, messages);
currentConfiguration = newConfiguration;
return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override()
+ public boolean isConfigurationAcceptable(PluginCfg configuration,
+ List<Message> unacceptableReasons)
+ {
+ ReferentialIntegrityPluginCfg cfg =
+ (ReferentialIntegrityPluginCfg) configuration;
+ return isConfigurationChangeAcceptable(cfg, unacceptableReasons);
+ }
+
+
/**
* {@inheritDoc}
*/
@@ -731,6 +746,17 @@
return name;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override()
+ public final void finalizePlugin() {
+ currentConfiguration.removeReferentialIntegrityChangeListener(this);
+ if(interval > 0)
+ processServerShutdown(null);
+ }
+
/**
* Process a server shutdown. If the background thread is running it needs
* to be interrupted so it can read the stop request variable and exit.
--
Gitblit v1.10.0