*/
@Override()
public boolean isConfigurationAcceptable(ConnectionHandlerCfg configuration,
List<Message> unacceptableReasons)
{
JMXConnectionHandlerCfg config = (JMXConnectionHandlerCfg) configuration;
if ((currentConfig == null) ||
(!currentConfig.isEnabled() && config.isEnabled()) ||
(currentConfig.getListenPort() != config.getListenPort())) {
// Attempt to bind to the listen port to verify whether the connection
// handler will be able to start.
try {
if (StaticUtils.isAddressInUse(
new InetSocketAddress(config.getListenPort()).getAddress(),
config.getListenPort(), true)) {
throw new IOException(
ERR_CONNHANDLER_ADDRESS_INUSE.get().toString());
}
} catch (Exception e) {
Message message = ERR_JMX_CONNHANDLER_CANNOT_BIND.get(
String.valueOf(config.dn()), config.getListenPort(),
getExceptionMessage(e));
unacceptableReasons.add(message);
return false;
}
}