fix for issue #2836 (dsconfig: after failed 1st attempt, 2nd attempt to connect to server exits)
Add a close method in the ManagementContextFactory interface
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2007 Sun Microsystems, Inc. |
| | | * Portions Copyright 2007-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.tools.dsconfig; |
| | | |
| | |
| | | |
| | | 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 |
| | | } |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2007 Sun Microsystems, Inc. |
| | | * Portions Copyright 2007-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.tools.dsconfig; |
| | | |
| | |
| | | this.context = context; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void close() |
| | | { |
| | | // No implementation required. |
| | | // We let the user of this InternalManagementContextFactory close |
| | | // his/her context. |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2007 Sun Microsystems, Inc. |
| | | * Portions Copyright 2007-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.tools.dsconfig; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * {@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. |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2007 Sun Microsystems, Inc. |
| | | * Portions Copyright 2007-2008 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.tools.dsconfig; |
| | | |
| | |
| | | throws ArgumentException, ClientException; |
| | | |
| | | |
| | | /** |
| | | * Closes this management context. |
| | | */ |
| | | void close(); |
| | | |
| | | |
| | | /** |
| | | * Initializes this management context factory using the provided |