gemmellr commented on a change in pull request #3969:
URL: https://github.com/apache/activemq-artemis/pull/3969#discussion_r818583172
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/spi/core/remoting/Acceptor.java
##########
@@ -83,4 +83,15 @@
default ProtocolHandler getProtocolHandler() {
return null;
}
+
+ /**
+ * This is a utility method for Socket-based acceptor implementations to
get the actual port used.
+ * This is useful for configurations which specify a port number of 0 which
allows the JVM to select
+ * an ephemeral port.
+ *
+ * @return the actual port used if using a Socket-based acceptor
implementation; null otherwise
+ */
+ default Integer getActualPort() {
+ return null;
Review comment:
Perhaps just -1 rather than a null? Keeps it all-int, avoiding need for
Integer boxing the actual impl doesnt need and potential for NPE, while still
being equally invalid as a port number?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]