Author: chirino
Date: Thu Jan 6 17:58:32 2011
New Revision: 1055970
URL: http://svn.apache.org/viewvc?rev=1055970&view=rev
Log:
Only startup the web admin if it's defined in the apollo broker file. removed
the enabled attribute.
Modified:
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Stop.scala
activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/WebAdminDTO.java
activemq/activemq-apollo/trunk/apollo-website/src/documentation/getting-started.md
activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md
Modified:
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala?rev=1055970&r1=1055969&r2=1055970&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
(original)
+++
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Run.scala
Thu Jan 6 17:58:32 2011
@@ -107,11 +107,10 @@ class Run extends Action with Logging {
info("Broker started");
})
- val web_admin = config.web_admin.getOrElse(new WebAdminDTO)
- if( web_admin.enabled.getOrElse(true) ) {
+ config.web_admin.foreach { web_admin=>
val prefix = web_admin.prefix.getOrElse("/")
- val port = web_admin.port.getOrElse(8080)
+ val port = web_admin.port.getOrElse(61680)
val host = web_admin.host.getOrElse("127.0.0.1")
// Start up the admin interface...
Modified:
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Stop.scala
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Stop.scala?rev=1055970&r1=1055969&r2=1055970&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Stop.scala
(original)
+++
activemq/activemq-apollo/trunk/apollo-cli/src/main/scala/org/apache/activemq/apollo/cli/commands/Stop.scala
Thu Jan 6 17:58:32 2011
@@ -58,27 +58,28 @@ class Stop extends Action with Logging {
val config = new FileConfigStore(conf).load(true)
- val web_admin = config.web_admin.getOrElse(new WebAdminDTO)
- if( web_admin.enabled.getOrElse(true) ) {
-
- val prefix = web_admin.prefix.getOrElse("/").stripSuffix("/")
- val port = web_admin.port.getOrElse(8080)
- val host = web_admin.host.getOrElse("127.0.0.1")
-
- val auth = (user, password) match {
- case (null,null)=> None
- case (null,p)=> Some(":"+p)
- case (u,null)=> Some(u+":")
- case (u,p)=> Some(u+":"+p)
- }
-
- val connection = new URL(
- "http://%s:%s%s/runtime/action/shutdown".format(host, port, prefix)
- ).openConnection.asInstanceOf[HttpURLConnection]
- connection.setRequestMethod("POST");
- auth.foreach{x=> connection.setRequestProperty("Authorization", "Basic
"+new String(Base64.encodeBase64(x.getBytes("UTF-8")), "UTF-8")) }
- connection.getContent
-
+ Option(config.web_admin) match {
+ case None=>
+ error("Web admin not enabled for that configuration, sorry can't
shut the broker down");
+
+ case Some(web_admin)=>
+ val prefix = web_admin.prefix.getOrElse("/").stripSuffix("/")
+ val port = web_admin.port.getOrElse(8080)
+ val host = web_admin.host.getOrElse("127.0.0.1")
+
+ val auth = (user, password) match {
+ case (null,null)=> None
+ case (null,p)=> Some(":"+p)
+ case (u,null)=> Some(u+":")
+ case (u,p)=> Some(u+":"+p)
+ }
+
+ val connection = new URL(
+ "http://%s:%s%s/runtime/action/shutdown".format(host, port, prefix)
+ ).openConnection.asInstanceOf[HttpURLConnection]
+ connection.setRequestMethod("POST");
+ auth.foreach{x=> connection.setRequestProperty("Authorization",
"Basic "+new String(Base64.encodeBase64(x.getBytes("UTF-8")), "UTF-8")) }
+ connection.getContent
}
} catch {
Modified:
activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/WebAdminDTO.java
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/WebAdminDTO.java?rev=1055970&r1=1055969&r2=1055970&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/WebAdminDTO.java
(original)
+++
activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/WebAdminDTO.java
Thu Jan 6 17:58:32 2011
@@ -33,9 +33,6 @@ import java.util.Set;
public class WebAdminDTO {
@XmlAttribute
- public Boolean enabled;
-
- @XmlAttribute
public String host;
@XmlAttribute
Modified:
activemq/activemq-apollo/trunk/apollo-website/src/documentation/getting-started.md
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-website/src/documentation/getting-started.md?rev=1055970&r1=1055969&r2=1055970&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-website/src/documentation/getting-started.md
(original)
+++
activemq/activemq-apollo/trunk/apollo-website/src/documentation/getting-started.md
Thu Jan 6 17:58:32 2011
@@ -150,6 +150,6 @@ The consumer's output should look like:
Apollo provides a simple web interface to monitor the status of the broker.
Once
the admin interface will be accessible at:
-* [http://127.0.0.1:8080/](http://127.0.0.1:8080/)
+* [http://127.0.0.1:61680/](http://127.0.0.1:61680/)
The default login id and password is `admin` and `password`.
Modified:
activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md
URL:
http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md?rev=1055970&r1=1055969&r2=1055970&view=diff
==============================================================================
---
activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md
(original)
+++
activemq/activemq-apollo/trunk/apollo-website/src/documentation/user-manual.md
Thu Jan 6 17:58:32 2011
@@ -619,7 +619,7 @@ to the proper value before starting the
### Web Based Administration
${project_name} start a web based administration interface on
-[`http://127.0.0.1:8080`](http://127.0.0.1:8080) by default. Note
+[`http://127.0.0.1:61680`](http://127.0.0.1:61680) by default. Note
that it binds to the loopback interface so that only local web
browsers can access the interface.
@@ -628,10 +628,10 @@ configuring the admins of the broker, th
perform basic authentication and will only grant access to those users
which are in the admin ACL.
-If you want to change the port or the interface it binds on or perhaps
-even disable it altogether, then you should add a `web_admin`
-configuration element inside the `broker` element to change the
-default settings. For example:
+If you want to disable the web the interface then you should remove
+the `web_admin` configuration element.
+
+For example:
{pygmentize:: xml}
<broker xmlns="http://activemq.apache.org/schema/activemq/apollo">
@@ -672,7 +672,7 @@ system's tools.
${project_name} provides a web based interface for administrators to inspect
the runtime state of the Broker. If your running the broker on your local
-machine, just open your web browser to
[`http://localhost:8080`](http://localhost:8080).
+machine, just open your web browser to
[`http://localhost:61680`](http://localhost:61680).
The web interface will display the status of the the connectors and show
attached connections. It will also allow you to drill into each configured