| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.protocols.jmx; |
| | | import java.io.IOException; |
| | |
| | | listeners.clear(); |
| | | listeners.add(new HostPort(config.getListenPort())); |
| | | |
| | | rmiConnector.finalizeConnectionHandler(true, portChanged); |
| | | rmiConnector.finalizeConnectionHandler(portChanged); |
| | | try |
| | | { |
| | | rmiConnector.initialize(); |
| | |
| | | |
| | | |
| | | /** |
| | | * Closes this connection handler so that it will no longer accept |
| | | * new client connections. It may or may not disconnect existing |
| | | * client connections based on the provided flag. |
| | | * |
| | | * @param finalizeReason |
| | | * The reason that this connection handler should be |
| | | * finalized. |
| | | * @param closeConnections |
| | | * Indicates whether any established client connections |
| | | * associated with the connection handler should also be |
| | | * closed. |
| | | * {@inheritDoc} |
| | | */ |
| | | public void finalizeConnectionHandler(Message finalizeReason, |
| | | boolean closeConnections) { |
| | | @Override |
| | | public void finalizeConnectionHandler(Message finalizeReason) { |
| | | // Make sure that we don't get notified of any more changes. |
| | | currentConfig.removeJMXChangeListener(this); |
| | | |
| | | // We should also close the RMI registry. |
| | | rmiConnector.finalizeConnectionHandler(closeConnections, true); |
| | | rmiConnector.finalizeConnectionHandler(true); |
| | | } |
| | | |
| | | |
| | |
| | | * @return The set of active client connections that have been |
| | | * established through this connection handler. |
| | | */ |
| | | @Override |
| | | public Collection<ClientConnection> getClientConnections() { |
| | | return connectionList; |
| | | } |
| | |
| | | * @return The DN of the configuration entry with which this alert |
| | | * generator is associated. |
| | | */ |
| | | @Override |
| | | public DN getComponentEntryDN() { |
| | | return currentConfig.dn(); |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void initializeConnectionHandler(JMXConnectionHandlerCfg config) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getConnectionHandlerName() { |
| | | return connectionHandlerName; |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public String getProtocol() { |
| | | return protocol; |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public Collection<HostPort> getListeners() { |
| | | return listeners; |
| | | } |
| | |
| | | */ |
| | | public void processServerShutdown(Message reason) { |
| | | // We should also close the RMI registry. |
| | | rmiConnector.finalizeConnectionHandler(true, true); |
| | | rmiConnector.finalizeConnectionHandler(true); |
| | | } |
| | | |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void run() { |
| | | try |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void toString(StringBuilder buffer) { |
| | | buffer.append(connectionHandlerName); |
| | | } |