In the previous implementation, each time we had a configuration change,
the JMX connector **AND** the RMI registry was closed.
With this modification, the RMI registry will be closed only if it's
required, basically, if there is a change port request or if the connector.
| | |
| | | String finalizeReason, boolean closeConnections) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "finalizeConnectionHandler"); |
| | | rmiConnector.finalizeConnectionHandler(closeConnections); |
| | | |
| | | // We should also close the RMI registry. |
| | | rmiConnector.finalizeConnectionHandler(closeConnections, true); |
| | | } |
| | | |
| | | /** |
| | |
| | | public void processServerShutdown(String reason) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "processServerShutdown"); |
| | | rmiConnector.finalizeConnectionHandler(true); |
| | | // We should also close the RMI registry. |
| | | rmiConnector.finalizeConnectionHandler(true, true); |
| | | |
| | | } |
| | | |
| | |
| | | // |
| | | // Stop the current connector |
| | | // TODO Set Msg |
| | | this.finalizeConnectionHandler("new config", true); |
| | | this.rmiConnector.finalizeConnectionHandler(true, |
| | | (listenPort != newListenPort)); |
| | | |
| | | // |
| | | // set new params and update JMX attributes |
| | |
| | | import java.rmi.RemoteException; |
| | | import java.rmi.registry.LocateRegistry; |
| | | import java.rmi.registry.Registry; |
| | | import java.rmi.server.RMISocketFactory; |
| | | import java.util.HashMap; |
| | | |
| | | import javax.net.ssl.SSLSocketFactory; |
| | |
| | | if (registry == null) |
| | | { |
| | | rmiSsf = new OpendsRmiServerSocketFactory(); |
| | | registry = LocateRegistry.createRegistry(registryPort, |
| | | RMISocketFactory.getDefaultSocketFactory(), rmiSsf); |
| | | registry = LocateRegistry.createRegistry(registryPort, null, rmiSsf); |
| | | } |
| | | } |
| | | catch (RemoteException re) |
| | |
| | | * Indicates whether any established client connections |
| | | * associated with the connection handler should also be |
| | | * closed. |
| | | * @param stopRegistry Indicates if the RMI registry should be stopped |
| | | */ |
| | | public void finalizeConnectionHandler(boolean closeConnections) |
| | | public void finalizeConnectionHandler( |
| | | boolean closeConnections, boolean stopRegistry) |
| | | { |
| | | if (closeConnections) |
| | | { |
| | |
| | | assert debugException(CLASS_NAME, "finalizeConnectionHandler", e); |
| | | } |
| | | |
| | | if (stopRegistry) |
| | | { |
| | | // |
| | | // Close the socket |
| | | try |
| | |
| | | } |
| | | registry = null; |
| | | } |
| | | |
| | | } |
| | | } |