mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
11.02.2006 90e372637db76c6c9dd14a1206d28c1cb0298590
Update the plugin API to make the shutdown reason available to shutdown
plugins.

OpenDS Issue Number: 995
5 files modified
22 ■■■■■ changed files
opends/src/server/org/opends/server/api/plugin/DirectoryServerPlugin.java 7 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/DirectoryServer.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/PluginConfigManager.java 9 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java 2 ●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/api/plugin/DirectoryServerPlugin.java
@@ -204,10 +204,13 @@
   * method will be called early in the shutdown process after the
   * connection handlers are stopped but before other finalization is
   * performed.
   *
   * @param  reason  The human-readable reason for the shutdown.
   */
  public void doShutdown()
  public void doShutdown(String reason)
  {
    assert debugEnter(CLASS_NAME, "doShutdown");
    assert debugEnter(CLASS_NAME, "doShutdown",
                      String.valueOf(reason));
    int    msgID   = MSGID_PLUGIN_TYPE_NOT_SUPPORTED;
    String message = getMessage(msgID, String.valueOf(pluginDN),
opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -6703,7 +6703,7 @@
    // the server.
    if (directoryServer.pluginConfigManager != null)
    {
      directoryServer.pluginConfigManager.invokeShutdownPlugins();
      directoryServer.pluginConfigManager.invokeShutdownPlugins(reason);
      directoryServer.pluginConfigManager.finalizePlugins();
    }
opends/src/server/org/opends/server/core/PluginConfigManager.java
@@ -1693,17 +1693,20 @@
  /**
   * Invokes the set of shutdown plugins that have been configured in the
   * Directory Server.
   *
   * @param  reason  The human-readable reason for the shutdown.
   */
  public void invokeShutdownPlugins()
  public void invokeShutdownPlugins(String reason)
  {
    assert debugEnter(CLASS_NAME, "invokeShutdownPlugins");
    assert debugEnter(CLASS_NAME, "invokeShutdownPlugins",
                      String.valueOf(reason));
    for (DirectoryServerPlugin p : shutdownPlugins)
    {
      try
      {
        p.doShutdown();
        p.doShutdown(reason);
      }
      catch (Exception e)
      {
opends/tests/unit-tests-testng/src/server/org/opends/server/api/plugin/DirectoryServerPluginTestCase.java
@@ -125,7 +125,7 @@
  @Test(expectedExceptions = { UnsupportedOperationException.class })
  public void testDoShutdown()
  {
    new NullPlugin().doShutdown();
    new NullPlugin().doShutdown("testDoShutdown");
  }
opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/InvocationCounterPlugin.java
@@ -1035,7 +1035,7 @@
   * {@inheritDoc}
   */
  @Override()
  public void doShutdown()
  public void doShutdown(String reason)
  {
    shutdownCalled = true;
  }