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

lutoff
17.54.2008 9bce07b9bff3d251fe7284f7096a6e828279a6c2
fix for issue #2836 (dsconfig: after failed 1st attempt, 2nd attempt to connect to server exits)

Add a close method in the ManagementContextFactory interface
4 files modified
36 ■■■■ changed files
opends/src/server/org/opends/server/tools/dsconfig/DSConfig.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/InternalManagementContextFactory.java 12 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/LDAPManagementContextFactory.java 13 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/ManagementContextFactory.java 7 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/DSConfig.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 *      Portions Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.server.tools.dsconfig;
@@ -742,7 +742,7 @@
      try {
        // Close the Management context ==> an LDAP UNBIND is sent
        factory.getManagementContext(this).close();
        factory.close();
      } catch (Exception e) {
      // Nothing to report in this case
      }
opends/src/server/org/opends/server/tools/dsconfig/InternalManagementContextFactory.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 *      Portions Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.server.tools.dsconfig;
@@ -59,7 +59,15 @@
    this.context = context;
  }
  /**
   * {@inheritDoc}
   */
  public void close()
  {
    // No implementation required.
    // We let the user of this InternalManagementContextFactory close
    // his/her context.
  }
  /**
   * {@inheritDoc}
opends/src/server/org/opends/server/tools/dsconfig/LDAPManagementContextFactory.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 *      Portions Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.server.tools.dsconfig;
@@ -94,6 +94,17 @@
  }
  /**
   * {@inheritDoc}
   */
  public void close()
  {
    if (context != null)
    {
      context.close();
    }
  }
  /**
   * Gets the management context which sub-commands should use in
   * order to manage the directory server. Implementations can use the
   * application instance for retrieving passwords interactively.
opends/src/server/org/opends/server/tools/dsconfig/ManagementContextFactory.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Portions Copyright 2007 Sun Microsystems, Inc.
 *      Portions Copyright 2007-2008 Sun Microsystems, Inc.
 */
package org.opends.server.tools.dsconfig;
@@ -64,6 +64,11 @@
      throws ArgumentException, ClientException;
  /**
   * Closes this management context.
   */
  void close();
  /**
   * Initializes this management context factory using the provided