You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by da...@apache.org on 2014/05/11 10:43:26 UTC
git commit: Add Jetty host property to resolve URL message
Repository: activemq
Updated Branches:
refs/heads/trunk 210e39df8 -> d37786ea1
Add Jetty host property to resolve URL message
Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/d37786ea
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/d37786ea
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/d37786ea
Branch: refs/heads/trunk
Commit: d37786ea130a111407e8c8afe1fd3b9bbe1b9bec
Parents: 210e39d
Author: Jason Sherman <js...@redhat.com>
Authored: Fri May 9 16:38:49 2014 -0400
Committer: Jason Sherman <js...@redhat.com>
Committed: Fri May 9 16:38:49 2014 -0400
----------------------------------------------------------------------
.../java/org/apache/activemq/web/WebConsoleStarter.java | 5 +++--
.../java/org/apache/activemq/web/WebConsolePort.java | 12 ++++++++++++
assembly/src/release/conf/jetty.xml | 2 ++
3 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq/blob/d37786ea/activemq-web-console/src/main/java/org/apache/activemq/web/WebConsoleStarter.java
----------------------------------------------------------------------
diff --git a/activemq-web-console/src/main/java/org/apache/activemq/web/WebConsoleStarter.java b/activemq-web-console/src/main/java/org/apache/activemq/web/WebConsoleStarter.java
index d6c5d6d..8ec8e22 100644
--- a/activemq-web-console/src/main/java/org/apache/activemq/web/WebConsoleStarter.java
+++ b/activemq-web-console/src/main/java/org/apache/activemq/web/WebConsoleStarter.java
@@ -49,8 +49,9 @@ public class WebConsoleStarter implements ServletContextListener {
if ("embedded".equals(webconsoleType)) {
// show the url for the web consoles / main page so people can spot it
String port = System.getProperty("jetty.port");
- if (port != null) {
- LOG.info("ActiveMQ WebConsole available at http://localhost:{}/", port);
+ String host = System.getProperty("jetty.host");
+ if (host != null && port != null) {
+ LOG.info("ActiveMQ WebConsole available at http://{}:{}/", host, port);
}
}
http://git-wip-us.apache.org/repos/asf/activemq/blob/d37786ea/activemq-web/src/main/java/org/apache/activemq/web/WebConsolePort.java
----------------------------------------------------------------------
diff --git a/activemq-web/src/main/java/org/apache/activemq/web/WebConsolePort.java b/activemq-web/src/main/java/org/apache/activemq/web/WebConsolePort.java
index 47691d7..3ba4128 100644
--- a/activemq-web/src/main/java/org/apache/activemq/web/WebConsolePort.java
+++ b/activemq-web/src/main/java/org/apache/activemq/web/WebConsolePort.java
@@ -21,9 +21,11 @@ package org.apache.activemq.web;
*/
public class WebConsolePort {
+ public static final String DEFAULT_HOST = "0.0.0.0";
public static final int DEFAULT_PORT = 8161;
private int port = DEFAULT_PORT;
+ private String host = DEFAULT_HOST;
public int getPort() {
return port;
@@ -33,9 +35,19 @@ public class WebConsolePort {
this.port = port;
}
+ public String getHost() {
+ return host;
+ }
+
+ public void setHost(String host) {
+ this.host = host;
+ }
+
public void start() {
// you may set a JVM system property for the jetty.port
String port = System.getProperty("jetty.port", "" + this.port);
System.setProperty("jetty.port", port);
+ String host = System.getProperty("jetty.host", "" + this.host);
+ System.setProperty("jetty.host", host);
}
}
http://git-wip-us.apache.org/repos/asf/activemq/blob/d37786ea/assembly/src/release/conf/jetty.xml
----------------------------------------------------------------------
diff --git a/assembly/src/release/conf/jetty.xml b/assembly/src/release/conf/jetty.xml
index a113a2c..2f77ee5 100644
--- a/assembly/src/release/conf/jetty.xml
+++ b/assembly/src/release/conf/jetty.xml
@@ -99,6 +99,7 @@
<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
<!-- the default port number for the web console -->
+ <property name="host" value="0.0.0.0"/>
<property name="port" value="8161"/>
</bean>
@@ -109,6 +110,7 @@
<list>
<bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<!-- see the jettyPort bean -->
+ <property name="host" value="#{systemProperties['jetty.host']}" />
<property name="port" value="#{systemProperties['jetty.port']}" />
</bean>
<!--