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 2013/10/04 14:10:37 UTC
[1/2] git commit: AMQ-7486: Log at INFO level on starting standalone
broker the http url of the web console
Updated Branches:
refs/heads/trunk 4f19f31a3 -> 84c4b9db5
AMQ-7486: Log at INFO level on starting standalone broker the http url of the web console
Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/84c4b9db
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/84c4b9db
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/84c4b9db
Branch: refs/heads/trunk
Commit: 84c4b9db56a08d81639d19a65db79a28f8f319ae
Parents: e889e36
Author: Claus Ibsen <cl...@gmail.com>
Authored: Fri Oct 4 14:09:48 2013 +0200
Committer: Claus Ibsen <cl...@gmail.com>
Committed: Fri Oct 4 14:10:28 2013 +0200
----------------------------------------------------------------------
.../apache/activemq/web/WebConsoleStarter.java | 44 ++++++++++++--------
.../java/org/apache/activemq/web/tool/Main.java | 1 +
.../org/apache/activemq/web/WebConsolePort.java | 41 ++++++++++++++++++
assembly/src/release/conf/jetty.xml | 10 ++++-
4 files changed, 77 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq/blob/84c4b9db/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 4fa89f8..d6c5d6d 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
@@ -30,8 +30,6 @@ import javax.servlet.ServletContextListener;
/**
* Starts the WebConsole.
- *
- *
*/
public class WebConsoleStarter implements ServletContextListener {
@@ -40,30 +38,28 @@ public class WebConsoleStarter implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
LOG.debug("Initializing ActiveMQ WebConsole...");
+ String webconsoleType = getWebconsoleType();
+
ServletContext servletContext = event.getServletContext();
- WebApplicationContext context = createWebapplicationContext(servletContext);
+ WebApplicationContext context = createWebapplicationContext(servletContext, webconsoleType);
initializeWebClient(servletContext, context);
- LOG.info("ActiveMQ WebConsole initialized.");
- }
-
- private WebApplicationContext createWebapplicationContext(ServletContext servletContext) {
-
- String webconsoleType = System.getProperty("webconsole.type", "embedded");
-
- // detect osgi
- try {
- if (OsgiUtil.isOsgi()) {
- webconsoleType = "osgi";
+ // for embedded console log what port it uses
+ 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);
}
- } catch (NoClassDefFoundError ignore) {
}
+ LOG.debug("ActiveMQ WebConsole initialized.");
+ }
+ private WebApplicationContext createWebapplicationContext(ServletContext servletContext, String webconsoleType) {
String configuration = "/WEB-INF/webconsole-" + webconsoleType + ".xml";
-
- LOG.info("Web console type: " + webconsoleType);
+ LOG.debug("Web console type: " + webconsoleType);
XmlWebApplicationContext context = new XmlWebApplicationContext();
context.setServletContext(servletContext);
@@ -93,6 +89,20 @@ public class WebConsoleStarter implements ServletContextListener {
// do nothing, since the context is destroyed anyway
}
+ private static String getWebconsoleType() {
+ String webconsoleType = System.getProperty("webconsole.type", "embedded");
+
+ // detect osgi
+ try {
+ if (OsgiUtil.isOsgi()) {
+ webconsoleType = "osgi";
+ }
+ } catch (NoClassDefFoundError ignore) {
+ }
+
+ return webconsoleType;
+ }
+
static class OsgiUtil {
static boolean isOsgi() {
return (FrameworkUtil.getBundle(WebConsoleStarter.class) != null);
http://git-wip-us.apache.org/repos/asf/activemq/blob/84c4b9db/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
----------------------------------------------------------------------
diff --git a/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java b/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
index 1eb6583..7a419c3 100644
--- a/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
+++ b/activemq-web-console/src/test/java/org/apache/activemq/web/tool/Main.java
@@ -47,6 +47,7 @@ public final class Main {
port = Integer.parseInt(text);
}
System.out.println("Starting Web Server on port: " + port);
+ System.setProperty("jetty.port", "" + port);
Server server = new Server();
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(port);
http://git-wip-us.apache.org/repos/asf/activemq/blob/84c4b9db/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
new file mode 100644
index 0000000..47691d7
--- /dev/null
+++ b/activemq-web/src/main/java/org/apache/activemq/web/WebConsolePort.java
@@ -0,0 +1,41 @@
+/**
+ * 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.activemq.web;
+
+/**
+ * Bean to initialize the port number we use for embedded Jetty server for the web consoles.
+ */
+public class WebConsolePort {
+
+ public static final int DEFAULT_PORT = 8161;
+
+ private int port = DEFAULT_PORT;
+
+ public int getPort() {
+ return port;
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ 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);
+ }
+}
http://git-wip-us.apache.org/repos/asf/activemq/blob/84c4b9db/assembly/src/release/conf/jetty.xml
----------------------------------------------------------------------
diff --git a/assembly/src/release/conf/jetty.xml b/assembly/src/release/conf/jetty.xml
index 718efbd..f55b0c6 100644
--- a/assembly/src/release/conf/jetty.xml
+++ b/assembly/src/release/conf/jetty.xml
@@ -111,13 +111,19 @@
<bean id="contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection">
</bean>
- <bean id="Server" class="org.eclipse.jetty.server.Server" init-method="start"
+ <bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
+ <!-- the default port number for the web console -->
+ <property name="port" value="8161"/>
+ </bean>
+
+ <bean id="Server" depends-on="jettyPort" class="org.eclipse.jetty.server.Server" init-method="start"
destroy-method="stop">
<property name="connectors">
<list>
<bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">
- <property name="port" value="8161" />
+ <!-- see the jettyPort bean -->
+ <property name="port" value="#{systemProperties['jetty.port']}" />
</bean>
<!--
Enable this connector if you wish to use https with web console
[2/2] git commit: Upgrade hawtio to 1.2M20
Posted by da...@apache.org.
Upgrade hawtio to 1.2M20
Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/e889e363
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/e889e363
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/e889e363
Branch: refs/heads/trunk
Commit: e889e36335d22b1a9693479b1021b35212ff60a1
Parents: 4f19f31
Author: Claus Ibsen <cl...@gmail.com>
Authored: Fri Oct 4 12:56:22 2013 +0200
Committer: Claus Ibsen <cl...@gmail.com>
Committed: Fri Oct 4 14:10:28 2013 +0200
----------------------------------------------------------------------
pom.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq/blob/e889e363/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 151248d..c293ffd 100755
--- a/pom.xml
+++ b/pom.xml
@@ -60,8 +60,7 @@
<commons-primitives-version>1.0</commons-primitives-version>
<commons-net-version>3.3</commons-net-version>
<directory-version>2.0.0-M6</directory-version>
- <hawtio-version>1.2-M19</hawtio-version>
-
+ <hawtio-version>1.2-M20</hawtio-version>
<ftpserver-version>1.0.6</ftpserver-version>
<geronimo-version>1.0</geronimo-version>
<hadoop-version>1.0.0</hadoop-version>