You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2016/05/16 19:49:13 UTC
svn commit: r1744123 - in /qpid/java/trunk:
broker-core/src/main/java/org/apache/qpid/server/logging/messages/
broker-core/src/main/java/org/apache/qpid/server/model/
broker-core/src/main/java/org/apache/qpid/server/model/adapter/
broker-core/src/main/...
Author: rgodfrey
Date: Mon May 16 19:49:12 2016
New Revision: 1744123
URL: http://svn.apache.org/viewvc?rev=1744123&view=rev
Log:
QPID-6096 : Add more obvious logging on failure to bind ports / other broker child failures
Added:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/PortBindFailureException.java (with props)
Modified:
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Port_logmessages.properties
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java
qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingNetworkTransport.java
qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java?rev=1744123&r1=1744122&r2=1744123&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/BrokerMessages.java Mon May 16 19:49:12 2016
@@ -45,63 +45,60 @@ public class BrokerMessages
private static Locale _currentLocale = BrokerProperties.getLocale();
public static final String BROKER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker";
- public static final String CONFIG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.config";
- public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_data";
- public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stopped";
- public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_msgs";
+ public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.ready";
+ public static final String FAILED_CHILDREN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.failed_children";
+ public static final String FLOW_TO_DISK_ACTIVE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.flow_to_disk_active";
public static final String LISTENING_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.listening";
+ public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.startup";
+ public static final String MANAGEMENT_MODE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.management_mode";
public static final String FLOW_TO_DISK_INACTIVE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.flow_to_disk_inactive";
- public static final String FLOW_TO_DISK_ACTIVE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.flow_to_disk_active";
- public static final String MAX_MEMORY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.max_memory";
+ public static final String STATS_MSGS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_msgs";
public static final String PLATFORM_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.platform";
- public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.operation";
- public static final String PROCESS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.process";
+ public static final String CONFIG_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.config";
public static final String SHUTTING_DOWN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.shutting_down";
- public static final String MANAGEMENT_MODE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.management_mode";
- public static final String STARTUP_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.startup";
+ public static final String STATS_DATA_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stats_data";
public static final String FATAL_ERROR_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.fatal_error";
- public static final String READY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.ready";
+ public static final String OPERATION_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.operation";
+ public static final String STOPPED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.stopped";
+ public static final String PROCESS_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.process";
+ public static final String MAX_MEMORY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "broker.max_memory";
static
{
LoggerFactory.getLogger(BROKER_LOG_HIERARCHY);
- LoggerFactory.getLogger(CONFIG_LOG_HIERARCHY);
- LoggerFactory.getLogger(STATS_DATA_LOG_HIERARCHY);
- LoggerFactory.getLogger(STOPPED_LOG_HIERARCHY);
- LoggerFactory.getLogger(STATS_MSGS_LOG_HIERARCHY);
+ LoggerFactory.getLogger(READY_LOG_HIERARCHY);
+ LoggerFactory.getLogger(FAILED_CHILDREN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(FLOW_TO_DISK_ACTIVE_LOG_HIERARCHY);
LoggerFactory.getLogger(LISTENING_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STARTUP_LOG_HIERARCHY);
+ LoggerFactory.getLogger(MANAGEMENT_MODE_LOG_HIERARCHY);
LoggerFactory.getLogger(FLOW_TO_DISK_INACTIVE_LOG_HIERARCHY);
- LoggerFactory.getLogger(FLOW_TO_DISK_ACTIVE_LOG_HIERARCHY);
- LoggerFactory.getLogger(MAX_MEMORY_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STATS_MSGS_LOG_HIERARCHY);
LoggerFactory.getLogger(PLATFORM_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
- LoggerFactory.getLogger(PROCESS_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CONFIG_LOG_HIERARCHY);
LoggerFactory.getLogger(SHUTTING_DOWN_LOG_HIERARCHY);
- LoggerFactory.getLogger(MANAGEMENT_MODE_LOG_HIERARCHY);
- LoggerFactory.getLogger(STARTUP_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STATS_DATA_LOG_HIERARCHY);
LoggerFactory.getLogger(FATAL_ERROR_LOG_HIERARCHY);
- LoggerFactory.getLogger(READY_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPERATION_LOG_HIERARCHY);
+ LoggerFactory.getLogger(STOPPED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(PROCESS_LOG_HIERARCHY);
+ LoggerFactory.getLogger(MAX_MEMORY_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Broker_logmessages", _currentLocale);
}
/**
* Log a Broker message of the Format:
- * <pre>BRK-1006 : Using configuration : {0}</pre>
+ * <pre>BRK-1004 : Qpid Broker Ready</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CONFIG(String param1)
+ public static LogMessage READY()
{
- String rawMessage = _messages.getString("CONFIG");
-
- final Object[] messageArguments = {param1};
- // Create a new MessageFormat to ensure thread safety.
- // Sharing a MessageFormat and using applyPattern is not thread safe
- MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+ String rawMessage = _messages.getString("READY");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -112,7 +109,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return CONFIG_LOG_HIERARCHY;
+ return READY_LOG_HIERARCHY;
}
@Override
@@ -145,16 +142,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1008 : {0,choice,0#delivered|1#received} : {1,number,#.###} kB/s peak : {2,number,#} bytes total</pre>
+ * <pre>BRK-1019 : WARNING - some services were unable to start. The following components are in the ERRORed state {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage STATS_DATA(Number param1, Number param2, Number param3)
+ public static LogMessage FAILED_CHILDREN(String param1)
{
- String rawMessage = _messages.getString("STATS_DATA");
+ String rawMessage = _messages.getString("FAILED_CHILDREN");
- final Object[] messageArguments = {param1, param2, param3};
+ final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -170,7 +167,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return STATS_DATA_LOG_HIERARCHY;
+ return FAILED_CHILDREN_LOG_HIERARCHY;
}
@Override
@@ -203,16 +200,21 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1005 : Stopped</pre>
+ * <pre>BRK-1014 : Message flow to disk active : Message memory use {0,number,#}KB exceeds threshold {1,number,#.##}KB</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage STOPPED()
+ public static LogMessage FLOW_TO_DISK_ACTIVE(Number param1, Number param2)
{
- String rawMessage = _messages.getString("STOPPED");
+ String rawMessage = _messages.getString("FLOW_TO_DISK_ACTIVE");
- final String message = rawMessage;
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
return new LogMessage()
{
@@ -223,7 +225,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return STOPPED_LOG_HIERARCHY;
+ return FLOW_TO_DISK_ACTIVE_LOG_HIERARCHY;
}
@Override
@@ -256,16 +258,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1009 : {0,choice,0#delivered|1#received} : {1,number,#.###} msg/s peak : {2,number,#} msgs total</pre>
+ * <pre>BRK-1002 : Starting : Listening on {0} port {1,number,#}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage STATS_MSGS(Number param1, Number param2, Number param3)
+ public static LogMessage LISTENING(String param1, Number param2)
{
- String rawMessage = _messages.getString("STATS_MSGS");
+ String rawMessage = _messages.getString("LISTENING");
- final Object[] messageArguments = {param1, param2, param3};
+ final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -281,7 +283,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return STATS_MSGS_LOG_HIERARCHY;
+ return LISTENING_LOG_HIERARCHY;
}
@Override
@@ -314,14 +316,14 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1002 : Starting : Listening on {0} port {1,number,#}</pre>
+ * <pre>BRK-1001 : Startup : Version: {0} Build: {1}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage LISTENING(String param1, Number param2)
+ public static LogMessage STARTUP(String param1, String param2)
{
- String rawMessage = _messages.getString("LISTENING");
+ String rawMessage = _messages.getString("STARTUP");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -339,7 +341,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return LISTENING_LOG_HIERARCHY;
+ return STARTUP_LOG_HIERARCHY;
}
@Override
@@ -372,14 +374,14 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1015 : Message flow to disk inactive : Message memory use {0,number,#}KB within threshold {1,number,#.##}KB</pre>
+ * <pre>BRK-1012 : Management Mode : User Details : {0} / {1}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage FLOW_TO_DISK_INACTIVE(Number param1, Number param2)
+ public static LogMessage MANAGEMENT_MODE(String param1, String param2)
{
- String rawMessage = _messages.getString("FLOW_TO_DISK_INACTIVE");
+ String rawMessage = _messages.getString("MANAGEMENT_MODE");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -397,7 +399,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return FLOW_TO_DISK_INACTIVE_LOG_HIERARCHY;
+ return MANAGEMENT_MODE_LOG_HIERARCHY;
}
@Override
@@ -430,14 +432,14 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1014 : Message flow to disk active : Message memory use {0,number,#}KB exceeds threshold {1,number,#.##}KB</pre>
+ * <pre>BRK-1015 : Message flow to disk inactive : Message memory use {0,number,#}KB within threshold {1,number,#.##}KB</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage FLOW_TO_DISK_ACTIVE(Number param1, Number param2)
+ public static LogMessage FLOW_TO_DISK_INACTIVE(Number param1, Number param2)
{
- String rawMessage = _messages.getString("FLOW_TO_DISK_ACTIVE");
+ String rawMessage = _messages.getString("FLOW_TO_DISK_INACTIVE");
final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
@@ -455,7 +457,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return FLOW_TO_DISK_ACTIVE_LOG_HIERARCHY;
+ return FLOW_TO_DISK_INACTIVE_LOG_HIERARCHY;
}
@Override
@@ -488,16 +490,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1011 : Maximum Memory : Heap : {0,number} bytes Direct : {1,number} bytes</pre>
+ * <pre>BRK-1009 : {0,choice,0#delivered|1#received} : {1,number,#.###} msg/s peak : {2,number,#} msgs total</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage MAX_MEMORY(Number param1, Number param2)
+ public static LogMessage STATS_MSGS(Number param1, Number param2, Number param3)
{
- String rawMessage = _messages.getString("MAX_MEMORY");
+ String rawMessage = _messages.getString("STATS_MSGS");
- final Object[] messageArguments = {param1, param2};
+ final Object[] messageArguments = {param1, param2, param3};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -513,7 +515,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return MAX_MEMORY_LOG_HIERARCHY;
+ return STATS_MSGS_LOG_HIERARCHY;
}
@Override
@@ -604,14 +606,14 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1018 : Operation : {0}</pre>
+ * <pre>BRK-1006 : Using configuration : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPERATION(String param1)
+ public static LogMessage CONFIG(String param1)
{
- String rawMessage = _messages.getString("OPERATION");
+ String rawMessage = _messages.getString("CONFIG");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -629,7 +631,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return OPERATION_LOG_HIERARCHY;
+ return CONFIG_LOG_HIERARCHY;
}
@Override
@@ -662,16 +664,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1017 : Process : PID : {0}</pre>
+ * <pre>BRK-1003 : Shutting down : {0} port {1,number,#}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage PROCESS(String param1)
+ public static LogMessage SHUTTING_DOWN(String param1, Number param2)
{
- String rawMessage = _messages.getString("PROCESS");
+ String rawMessage = _messages.getString("SHUTTING_DOWN");
- final Object[] messageArguments = {param1};
+ final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -687,7 +689,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return PROCESS_LOG_HIERARCHY;
+ return SHUTTING_DOWN_LOG_HIERARCHY;
}
@Override
@@ -720,16 +722,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1003 : Shutting down : {0} port {1,number,#}</pre>
+ * <pre>BRK-1008 : {0,choice,0#delivered|1#received} : {1,number,#.###} kB/s peak : {2,number,#} bytes total</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage SHUTTING_DOWN(String param1, Number param2)
+ public static LogMessage STATS_DATA(Number param1, Number param2, Number param3)
{
- String rawMessage = _messages.getString("SHUTTING_DOWN");
+ String rawMessage = _messages.getString("STATS_DATA");
- final Object[] messageArguments = {param1, param2};
+ final Object[] messageArguments = {param1, param2, param3};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -745,7 +747,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return SHUTTING_DOWN_LOG_HIERARCHY;
+ return STATS_DATA_LOG_HIERARCHY;
}
@Override
@@ -778,16 +780,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1012 : Management Mode : User Details : {0} / {1}</pre>
+ * <pre>BRK-1016 : Fatal error : {0} : See log file for more information</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage MANAGEMENT_MODE(String param1, String param2)
+ public static LogMessage FATAL_ERROR(String param1)
{
- String rawMessage = _messages.getString("MANAGEMENT_MODE");
+ String rawMessage = _messages.getString("FATAL_ERROR");
- final Object[] messageArguments = {param1, param2};
+ final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -803,7 +805,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return MANAGEMENT_MODE_LOG_HIERARCHY;
+ return FATAL_ERROR_LOG_HIERARCHY;
}
@Override
@@ -836,16 +838,16 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1001 : Startup : Version: {0} Build: {1}</pre>
+ * <pre>BRK-1018 : Operation : {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage STARTUP(String param1, String param2)
+ public static LogMessage OPERATION(String param1)
{
- String rawMessage = _messages.getString("STARTUP");
+ String rawMessage = _messages.getString("OPERATION");
- final Object[] messageArguments = {param1, param2};
+ final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -861,7 +863,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return STARTUP_LOG_HIERARCHY;
+ return OPERATION_LOG_HIERARCHY;
}
@Override
@@ -894,14 +896,67 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1016 : Fatal error : {0} : See log file for more information</pre>
+ * <pre>BRK-1005 : Stopped</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage FATAL_ERROR(String param1)
+ public static LogMessage STOPPED()
{
- String rawMessage = _messages.getString("FATAL_ERROR");
+ String rawMessage = _messages.getString("STOPPED");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return STOPPED_LOG_HIERARCHY;
+ }
+
+ @Override
+ public boolean equals(final Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final LogMessage that = (LogMessage) o;
+
+ return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
+
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = toString().hashCode();
+ result = 31 * result + getLogHierarchy().hashCode();
+ return result;
+ }
+ };
+ }
+
+ /**
+ * Log a Broker message of the Format:
+ * <pre>BRK-1017 : Process : PID : {0}</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage PROCESS(String param1)
+ {
+ String rawMessage = _messages.getString("PROCESS");
final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
@@ -919,7 +974,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return FATAL_ERROR_LOG_HIERARCHY;
+ return PROCESS_LOG_HIERARCHY;
}
@Override
@@ -952,16 +1007,21 @@ public class BrokerMessages
/**
* Log a Broker message of the Format:
- * <pre>BRK-1004 : Qpid Broker Ready</pre>
+ * <pre>BRK-1011 : Maximum Memory : Heap : {0,number} bytes Direct : {1,number} bytes</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage READY()
+ public static LogMessage MAX_MEMORY(Number param1, Number param2)
{
- String rawMessage = _messages.getString("READY");
+ String rawMessage = _messages.getString("MAX_MEMORY");
- final String message = rawMessage;
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
return new LogMessage()
{
@@ -972,7 +1032,7 @@ public class BrokerMessages
public String getLogHierarchy()
{
- return READY_LOG_HIERARCHY;
+ return MAX_MEMORY_LOG_HIERARCHY;
}
@Override
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties?rev=1744123&r1=1744122&r2=1744123&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Broker_logmessages.properties Mon May 16 19:49:12 2016
@@ -61,3 +61,5 @@ PROCESS = BRK-1017 : Process : PID : {0}
# 0 - operation name
OPERATION = BRK-1018 : Operation : {0}
+
+FAILED_CHILDREN = BRK-1019 : WARNING - some services were unable to start. The following components are in the ERRORed state {0}
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java?rev=1744123&r1=1744122&r2=1744123&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/PortMessages.java Mon May 16 19:49:12 2016
@@ -45,42 +45,49 @@ public class PortMessages
private static Locale _currentLocale = BrokerProperties.getLocale();
public static final String PORT_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port";
- public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.open";
- public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.create";
public static final String DELETE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.delete";
- public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.close";
+ public static final String CREATE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.create";
+ public static final String UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.unsupported_protocol_header";
public static final String CONNECTION_REJECTED_CLOSED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.connection_rejected_closed";
- public static final String CONNECTION_REJECTED_TOO_MANY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.connection_rejected_too_many";
public static final String CONNECTION_COUNT_WARN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.connection_count_warn";
- public static final String UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.unsupported_protocol_header";
+ public static final String BIND_FAILED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.bind_failed";
+ public static final String CLOSE_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.close";
+ public static final String CONNECTION_REJECTED_TOO_MANY_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.connection_rejected_too_many";
+ public static final String OPEN_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "port.open";
static
{
LoggerFactory.getLogger(PORT_LOG_HIERARCHY);
- LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
- LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
LoggerFactory.getLogger(DELETE_LOG_HIERARCHY);
- LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
- LoggerFactory.getLogger(CONNECTION_COUNT_WARN_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CREATE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY);
LoggerFactory.getLogger(CONNECTION_REJECTED_CLOSED_LOG_HIERARCHY);
LoggerFactory.getLogger(CONNECTION_COUNT_WARN_LOG_HIERARCHY);
- LoggerFactory.getLogger(UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY);
+ LoggerFactory.getLogger(BIND_FAILED_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CLOSE_LOG_HIERARCHY);
+ LoggerFactory.getLogger(CONNECTION_REJECTED_TOO_MANY_LOG_HIERARCHY);
+ LoggerFactory.getLogger(OPEN_LOG_HIERARCHY);
_messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.Port_logmessages", _currentLocale);
}
/**
* Log a Port message of the Format:
- * <pre>PRT-1002 : Open</pre>
+ * <pre>PRT-1006 : Delete {0} Port "{1}"</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage OPEN()
+ public static LogMessage DELETE(String param1, String param2)
{
- String rawMessage = _messages.getString("OPEN");
+ String rawMessage = _messages.getString("DELETE");
- final String message = rawMessage;
+ final Object[] messageArguments = {param1, param2};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
return new LogMessage()
{
@@ -91,7 +98,7 @@ public class PortMessages
public String getLogHierarchy()
{
- return OPEN_LOG_HIERARCHY;
+ return DELETE_LOG_HIERARCHY;
}
@Override
@@ -182,16 +189,16 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1006 : Delete {0} Port "{1}"</pre>
+ * <pre>PRT-1007 : Unsupported protocol header received, replying with {0}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage DELETE(String param1, String param2)
+ public static LogMessage UNSUPPORTED_PROTOCOL_HEADER(String param1)
{
- String rawMessage = _messages.getString("DELETE");
+ String rawMessage = _messages.getString("UNSUPPORTED_PROTOCOL_HEADER");
- final Object[] messageArguments = {param1, param2};
+ final Object[] messageArguments = {param1};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -207,7 +214,7 @@ public class PortMessages
public String getLogHierarchy()
{
- return DELETE_LOG_HIERARCHY;
+ return UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY;
}
@Override
@@ -240,16 +247,21 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1003 : Close</pre>
+ * <pre>PRT-1008 : Connection from {0} rejected. Port closed.</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CLOSE()
+ public static LogMessage CONNECTION_REJECTED_CLOSED(String param1)
{
- String rawMessage = _messages.getString("CLOSE");
+ String rawMessage = _messages.getString("CONNECTION_REJECTED_CLOSED");
- final String message = rawMessage;
+ final Object[] messageArguments = {param1};
+ // Create a new MessageFormat to ensure thread safety.
+ // Sharing a MessageFormat and using applyPattern is not thread safe
+ MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+
+ final String message = formatter.format(messageArguments);
return new LogMessage()
{
@@ -260,7 +272,7 @@ public class PortMessages
public String getLogHierarchy()
{
- return CLOSE_LOG_HIERARCHY;
+ return CONNECTION_REJECTED_CLOSED_LOG_HIERARCHY;
}
@Override
@@ -293,16 +305,16 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1005 : Connection from {0} rejected. Maximum connection count ({1, number}) for this port already reached.</pre>
+ * <pre>PRT-1004 : Connection count {0,number} within {1, number} % of maximum {2,number}</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CONNECTION_REJECTED_TOO_MANY(String param1, Number param2)
+ public static LogMessage CONNECTION_COUNT_WARN(Number param1, Number param2, Number param3)
{
- String rawMessage = _messages.getString("CONNECTION_REJECTED_TOO_MANY");
+ String rawMessage = _messages.getString("CONNECTION_COUNT_WARN");
- final Object[] messageArguments = {param1, param2};
+ final Object[] messageArguments = {param1, param2, param3};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -318,7 +330,7 @@ public class PortMessages
public String getLogHierarchy()
{
- return CONNECTION_REJECTED_TOO_MANY_LOG_HIERARCHY;
+ return CONNECTION_COUNT_WARN_LOG_HIERARCHY;
}
@Override
@@ -351,16 +363,16 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1008 : Connection from {0} rejected. Port closed.</pre>
+ * <pre>PRT-1009 : FAILED to bind {0} service to {1,number,#} - port in use</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CONNECTION_REJECTED_CLOSED(String param1)
+ public static LogMessage BIND_FAILED(String param1, Number param2)
{
- String rawMessage = _messages.getString("CONNECTION_REJECTED_CLOSED");
+ String rawMessage = _messages.getString("BIND_FAILED");
- final Object[] messageArguments = {param1};
+ final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -376,7 +388,7 @@ public class PortMessages
public String getLogHierarchy()
{
- return CONNECTION_REJECTED_CLOSED_LOG_HIERARCHY;
+ return BIND_FAILED_LOG_HIERARCHY;
}
@Override
@@ -409,21 +421,16 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1004 : Connection count {0,number} within {1, number} % of maximum {2,number}</pre>
+ * <pre>PRT-1003 : Close</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage CONNECTION_COUNT_WARN(Number param1, Number param2, Number param3)
+ public static LogMessage CLOSE()
{
- String rawMessage = _messages.getString("CONNECTION_COUNT_WARN");
-
- final Object[] messageArguments = {param1, param2, param3};
- // Create a new MessageFormat to ensure thread safety.
- // Sharing a MessageFormat and using applyPattern is not thread safe
- MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
+ String rawMessage = _messages.getString("CLOSE");
- final String message = formatter.format(messageArguments);
+ final String message = rawMessage;
return new LogMessage()
{
@@ -434,7 +441,7 @@ public class PortMessages
public String getLogHierarchy()
{
- return CONNECTION_COUNT_WARN_LOG_HIERARCHY;
+ return CLOSE_LOG_HIERARCHY;
}
@Override
@@ -467,16 +474,16 @@ public class PortMessages
/**
* Log a Port message of the Format:
- * <pre>PRT-1007 : Unsupported protocol header received, replying with {0}</pre>
+ * <pre>PRT-1005 : Connection from {0} rejected. Maximum connection count ({1, number}) for this port already reached.</pre>
* Optional values are contained in [square brackets] and are numbered
* sequentially in the method call.
*
*/
- public static LogMessage UNSUPPORTED_PROTOCOL_HEADER(String param1)
+ public static LogMessage CONNECTION_REJECTED_TOO_MANY(String param1, Number param2)
{
- String rawMessage = _messages.getString("UNSUPPORTED_PROTOCOL_HEADER");
+ String rawMessage = _messages.getString("CONNECTION_REJECTED_TOO_MANY");
- final Object[] messageArguments = {param1};
+ final Object[] messageArguments = {param1, param2};
// Create a new MessageFormat to ensure thread safety.
// Sharing a MessageFormat and using applyPattern is not thread safe
MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale);
@@ -492,7 +499,7 @@ public class PortMessages
public String getLogHierarchy()
{
- return UNSUPPORTED_PROTOCOL_HEADER_LOG_HIERARCHY;
+ return CONNECTION_REJECTED_TOO_MANY_LOG_HIERARCHY;
}
@Override
@@ -523,6 +530,60 @@ public class PortMessages
};
}
+ /**
+ * Log a Port message of the Format:
+ * <pre>PRT-1002 : Open</pre>
+ * Optional values are contained in [square brackets] and are numbered
+ * sequentially in the method call.
+ *
+ */
+ public static LogMessage OPEN()
+ {
+ String rawMessage = _messages.getString("OPEN");
+
+ final String message = rawMessage;
+
+ return new LogMessage()
+ {
+ public String toString()
+ {
+ return message;
+ }
+
+ public String getLogHierarchy()
+ {
+ return OPEN_LOG_HIERARCHY;
+ }
+
+ @Override
+ public boolean equals(final Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ final LogMessage that = (LogMessage) o;
+
+ return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString());
+
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = toString().hashCode();
+ result = 31 * result + getLogHierarchy().hashCode();
+ return result;
+ }
+ };
+ }
+
+
private PortMessages()
{
}
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Port_logmessages.properties
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Port_logmessages.properties?rev=1744123&r1=1744122&r2=1744123&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Port_logmessages.properties (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/logging/messages/Port_logmessages.properties Mon May 16 19:49:12 2016
@@ -28,3 +28,5 @@ DELETE = PRT-1006 : Delete {0} Port "{1}
UNSUPPORTED_PROTOCOL_HEADER = PRT-1007 : Unsupported protocol header received, replying with {0}
CONNECTION_REJECTED_CLOSED = PRT-1008 : Connection from {0} rejected. Port closed.
+BIND_FAILED = PRT-1009 : FAILED to bind {0} service to {1,number,#} - port in use
+
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java?rev=1744123&r1=1744122&r2=1744123&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/AbstractConfiguredObject.java Mon May 16 19:49:12 2016
@@ -1745,7 +1745,7 @@ public abstract class AbstractConfigured
@Override
public String toString()
{
- return getClass().getSimpleName() + " [id=" + _id + ", name=" + getName() + "]";
+ return getCategoryClass().getSimpleName() + "[id=" + _id + ", name=" + getName() + ", type=" + getType() + "]";
}
public final ConfiguredObjectRecord asObjectRecord()
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java?rev=1744123&r1=1744122&r2=1744123&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java Mon May 16 19:49:12 2016
@@ -352,6 +352,7 @@ public class BrokerAdapter extends Abstr
{
boolean hasBrokerAnyErroredChildren = false;
+ List<ConfiguredObject<?>> failedChildren = new ArrayList<>();
for (final Class<? extends ConfiguredObject> childClass : getModel().getChildTypes(getCategoryClass()))
{
final Collection<? extends ConfiguredObject> children = getChildren(childClass);
@@ -363,11 +364,17 @@ public class BrokerAdapter extends Abstr
hasBrokerAnyErroredChildren = true;
LOGGER.warn("Broker child object '{}' of type '{}' is {}",
child.getName(), childClass.getSimpleName(), State.ERRORED);
+ failedChildren.add(child);
}
}
}
}
+ if(!failedChildren.isEmpty())
+ {
+ getEventLogger().message(BrokerMessages.FAILED_CHILDREN(failedChildren.toString()));
+ }
+
final boolean brokerShutdownOnErroredChild = getContextValue(Boolean.class,
BROKER_FAIL_STARTUP_WITH_ERRORED_CHILD);
if (!_parent.isManagementMode() && brokerShutdownOnErroredChild && hasBrokerAnyErroredChildren)
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java?rev=1744123&r1=1744122&r2=1744123&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AbstractPort.java Mon May 16 19:49:12 2016
@@ -322,7 +322,7 @@ public abstract class AbstractPort<X ext
@Override
public String toString()
{
- return getClass().getSimpleName() + " [id=" + getId() + ", name=" + getName() + ", port=" + getPort() + "]";
+ return getCategoryClass().getSimpleName() + "[id=" + getId() + ", name=" + getName() + ", type=" + getType() + ", port=" + getPort() + "]";
}
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java?rev=1744123&r1=1744122&r2=1744123&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/model/port/AmqpPortImpl.java Mon May 16 19:49:12 2016
@@ -73,6 +73,7 @@ import org.apache.qpid.server.plugin.Qpi
import org.apache.qpid.server.plugin.TransportProviderFactory;
import org.apache.qpid.server.security.SecurityManager;
import org.apache.qpid.server.transport.AcceptingTransport;
+import org.apache.qpid.server.transport.PortBindFailureException;
import org.apache.qpid.server.transport.TransportProvider;
import org.apache.qpid.server.util.PortUtil;
import org.apache.qpid.server.util.ServerScopedRuntimeException;
@@ -286,20 +287,28 @@ public class AmqpPortImpl extends Abstra
_sslContext = createSslContext();
}
Protocol defaultSupportedProtocolReply = getDefaultAmqpSupportedReply();
+ try
+ {
+ _transport = transportProvider.createTransport(transportSet,
+ _sslContext,
+ this,
+ getProtocols(),
+ defaultSupportedProtocolReply);
- _transport = transportProvider.createTransport(transportSet,
- _sslContext,
- this,
- getProtocols(),
- defaultSupportedProtocolReply);
-
- _transport.start();
- for (Transport transport : getTransports())
+ _transport.start();
+ for (Transport transport : getTransports())
+ {
+ _broker.getEventLogger()
+ .message(BrokerMessages.LISTENING(String.valueOf(transport),
+ _transport.getAcceptingPort()));
+ }
+ return State.ACTIVE;
+ }
+ catch (PortBindFailureException e)
{
- _broker.getEventLogger().message(BrokerMessages.LISTENING(String.valueOf(transport), _transport.getAcceptingPort()));
+ _broker.getEventLogger().message(PortMessages.BIND_FAILED(getType().toUpperCase(),getPort()));
+ throw e;
}
-
- return State.ACTIVE;
}
}
Modified: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingNetworkTransport.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingNetworkTransport.java?rev=1744123&r1=1744122&r2=1744123&view=diff
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingNetworkTransport.java (original)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/NonBlockingNetworkTransport.java Mon May 16 19:49:12 2016
@@ -21,6 +21,7 @@
package org.apache.qpid.server.transport;
import java.io.IOException;
+import java.net.BindException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.StandardSocketOptions;
@@ -35,8 +36,6 @@ import org.slf4j.LoggerFactory;
import org.apache.qpid.configuration.CommonProperties;
import org.apache.qpid.transport.TransportException;
-import org.apache.qpid.transport.network.AggregateTicker;
-import org.apache.qpid.transport.network.Ticker;
import org.apache.qpid.transport.network.TransportEncryption;
import static org.apache.qpid.transport.ConnectionSettings.WILDCARD_ADDRESS;
@@ -86,7 +85,14 @@ public class NonBlockingNetworkTransport
_serverSocket = ServerSocketChannel.open();
_serverSocket.setOption(StandardSocketOptions.SO_REUSEADDR, true);
- _serverSocket.bind(_address, acceptBacklog);
+ try
+ {
+ _serverSocket.bind(_address, acceptBacklog);
+ }
+ catch (BindException e)
+ {
+ throw new PortBindFailureException(_address);
+ }
_serverSocket.configureBlocking(false);
_encryptionSet = encryptionSet;
_scheduler = scheduler;
Added: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/PortBindFailureException.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/PortBindFailureException.java?rev=1744123&view=auto
==============================================================================
--- qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/PortBindFailureException.java (added)
+++ qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/PortBindFailureException.java Mon May 16 19:49:12 2016
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.qpid.server.transport;
+
+import java.net.InetSocketAddress;
+
+public class PortBindFailureException extends RuntimeException
+{
+ private final InetSocketAddress _address;
+
+ public PortBindFailureException(final InetSocketAddress address)
+ {
+ super("Unable to bind to address " + address);
+ _address = address;
+ }
+
+ public InetSocketAddress getAddress()
+ {
+ return _address;
+ }
+}
Propchange: qpid/java/trunk/broker-core/src/main/java/org/apache/qpid/server/transport/PortBindFailureException.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java?rev=1744123&r1=1744122&r2=1744123&view=diff
==============================================================================
--- qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java (original)
+++ qpid/java/trunk/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java Mon May 16 19:49:12 2016
@@ -22,6 +22,8 @@ package org.apache.qpid.server.managemen
import java.io.IOException;
import java.io.Writer;
+import java.net.BindException;
+import java.net.InetSocketAddress;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Arrays;
@@ -48,6 +50,7 @@ import javax.servlet.http.HttpServletReq
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import org.apache.qpid.server.logging.messages.PortMessages;
import org.apache.qpid.server.management.plugin.filter.ExceptionHandlingFilter;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.server.Connector;
@@ -92,6 +95,7 @@ import org.apache.qpid.server.model.*;
import org.apache.qpid.server.model.adapter.AbstractPluginAdapter;
import org.apache.qpid.server.model.port.HttpPort;
import org.apache.qpid.server.model.port.PortManager;
+import org.apache.qpid.server.transport.PortBindFailureException;
import org.apache.qpid.server.util.ServerScopedRuntimeException;
import org.apache.qpid.transport.network.security.ssl.QpidMultipleTrustManager;
import org.apache.qpid.transport.network.security.ssl.SSLUtil;
@@ -170,6 +174,11 @@ public class HttpManagement extends Abst
_server.start();
logOperationalListenMessages();
}
+ catch (PortBindFailureException e)
+ {
+ getBroker().getEventLogger().message(PortMessages.BIND_FAILED("HTTP", e.getAddress().getPort()));
+ throw e;
+ }
catch (Exception e)
{
throw new ServerScopedRuntimeException("Failed to start HTTP management on ports : " + httpPorts, e);
@@ -340,6 +349,20 @@ public class HttpManagement extends Abst
super.customize(endpoint, request);
request.setAttribute(PORT_SERVLET_ATTRIBUTE, thePort);
}
+
+ public void open() throws IOException
+ {
+ try
+ {
+ super.open();
+ }
+ catch (BindException e)
+ {
+ InetSocketAddress addr = getHost() == null ? new InetSocketAddress(getPort())
+ : new InetSocketAddress(getHost(), getPort());
+ throw new PortBindFailureException(addr);
+ }
+ }
};
}
else if (transports.contains(Transport.SSL))
@@ -501,6 +524,20 @@ public class HttpManagement extends Abst
super.customize(endpoint, request);
request.setAttribute(PORT_SERVLET_ATTRIBUTE, port);
}
+
+ public void open() throws IOException
+ {
+ try
+ {
+ super.open();
+ }
+ catch (BindException e)
+ {
+ InetSocketAddress addr = getHost() == null ? new InetSocketAddress(getPort())
+ : new InetSocketAddress(getHost(), getPort());
+ throw new PortBindFailureException(addr);
+ }
+ }
}
: new SslSelectChannelConnector(factory)
{
@@ -510,6 +547,20 @@ public class HttpManagement extends Abst
super.customize(endpoint, request);
request.setAttribute(PORT_SERVLET_ATTRIBUTE, port);
}
+
+ public void open() throws IOException
+ {
+ try
+ {
+ super.open();
+ }
+ catch (BindException e)
+ {
+ InetSocketAddress addr = getHost() == null ? new InetSocketAddress(getPort())
+ : new InetSocketAddress(getHost(), getPort());
+ throw new PortBindFailureException(addr);
+ }
+ }
};
return connector;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org