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

neil_a_wilson
29.35.2007 90da5492eb74a2661a5624cbfad6a4bc9f85a99c
Update the Directory Server shutdown process to account for the possibility
that some components may not have been created yet if the shutdown is due to
a failure that occurred on startup.

OpenDS Issue Number: 1467
1 files modified
35 ■■■■■ changed files
opends/src/server/org/opends/server/core/DirectoryServer.java 35 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -7524,7 +7524,10 @@
    // Stop the work queue.
    directoryServer.workQueue.finalizeWorkQueue(reason);
    if (directoryServer.workQueue != null)
    {
      directoryServer.workQueue.finalizeWorkQueue(reason);
    }
    // Notify all the shutdown listeners.
@@ -7553,21 +7556,24 @@
    // Deregister all of the JMX MBeans.
    Set mBeanSet = directoryServer.mBeanServer.queryMBeans(null, null);
    for (Object o : mBeanSet)
    if (directoryServer.mBeanServer != null)
    {
      if (o instanceof DirectoryServerMBean)
      Set mBeanSet = directoryServer.mBeanServer.queryMBeans(null, null);
      for (Object o : mBeanSet)
      {
        try
        if (o instanceof DirectoryServerMBean)
        {
          DirectoryServerMBean mBean = (DirectoryServerMBean) o;
          directoryServer.mBeanServer.unregisterMBean(mBean.getObjectName());
        }
        catch (Exception e)
        {
          if (debugEnabled())
          try
          {
            debugCaught(DebugLogLevel.ERROR, e);
            DirectoryServerMBean mBean = (DirectoryServerMBean) o;
            directoryServer.mBeanServer.unregisterMBean(mBean.getObjectName());
          }
          catch (Exception e)
          {
            if (debugEnabled())
            {
              debugCaught(DebugLogLevel.ERROR, e);
            }
          }
        }
      }
@@ -7618,7 +7624,10 @@
    // Perform any necessary cleanup work for the group manager.
    directoryServer.groupManager.finalizeGroupManager();
    if (directoryServer.groupManager != null)
    {
      directoryServer.groupManager.finalizeGroupManager();
    }
    // Shut down all the other components that may need special handling.