activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject git commit: Align jetty-demo.xml with jetty.xml so we have the new web console included also.
Date Thu, 10 Oct 2013 14:27:56 GMT
Updated Branches:
  refs/heads/trunk e1b171e01 -> 3ae37a9ba


Align jetty-demo.xml with jetty.xml so we have the new web console included also.


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/3ae37a9b
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/3ae37a9b
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/3ae37a9b

Branch: refs/heads/trunk
Commit: 3ae37a9ba30c69b6f7aeb95406c14f1b400ad9ef
Parents: e1b171e
Author: Claus Ibsen <claus.ibsen@gmail.com>
Authored: Thu Oct 10 16:26:53 2013 +0200
Committer: Claus Ibsen <claus.ibsen@gmail.com>
Committed: Thu Oct 10 16:27:43 2013 +0200

----------------------------------------------------------------------
 assembly/src/sample-conf/jetty-demo.xml | 54 ++++++++++++++++++++++++----
 1 file changed, 47 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/3ae37a9b/assembly/src/sample-conf/jetty-demo.xml
----------------------------------------------------------------------
diff --git a/assembly/src/sample-conf/jetty-demo.xml b/assembly/src/sample-conf/jetty-demo.xml
index 1004cd6..cf8d970 100644
--- a/assembly/src/sample-conf/jetty-demo.xml
+++ b/assembly/src/sample-conf/jetty-demo.xml
@@ -27,12 +27,23 @@
 
     <bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint">
         <property name="name" value="BASIC" />
+        <property name="roles" value="user,admin" />
+        <!-- set authenticate=false to disable login -->
+        <property name="authenticate" value="true" />
+    </bean>
+    <bean id="adminSecurityConstraint" class="org.eclipse.jetty.util.security.Constraint">
+        <property name="name" value="BASIC" />
         <property name="roles" value="admin" />
+         <!-- set authenticate=false to disable login -->
         <property name="authenticate" value="true" />
     </bean>
     <bean id="securityConstraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">
         <property name="constraint" ref="securityConstraint" />
-        <property name="pathSpec" value="/*" />
+        <property name="pathSpec" value="/admin/*,*.jsp" />
+    </bean>
+    <bean id="adminSecurityConstraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">
+        <property name="constraint" ref="adminSecurityConstraint" />
+        <property name="pathSpec" value="*.action" />
     </bean>
     <bean id="securityHandler" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
         <property name="loginService" ref="securityLoginService" />
@@ -41,6 +52,7 @@
         </property>
         <property name="constraintMappings">
             <list>
+                <ref bean="adminSecurityConstraintMapping" />
                 <ref bean="securityConstraintMapping" />
             </list>
         </property>
@@ -49,20 +61,30 @@
                 <property name="handlers">
                     <list>
                         <bean class="org.eclipse.jetty.webapp.WebAppContext">
+                            <property name="contextPath" value="/hawtio" />
+                            <property name="war" value="${activemq.home}/webapps/hawtio"
/>
+                            <property name="logUrlOnStart" value="true" />
+                        </bean>
+                        <bean class="org.eclipse.jetty.webapp.WebAppContext">
                             <property name="contextPath" value="/admin" />
                             <property name="resourceBase" value="${activemq.home}/webapps/admin"
/>
                             <property name="logUrlOnStart" value="true" />
                         </bean>
                         <bean class="org.eclipse.jetty.webapp.WebAppContext">
+                            <property name="contextPath" value="/fileserver" />
+                            <property name="resourceBase" value="${activemq.home}/webapps/fileserver"
/>
+                            <property name="logUrlOnStart" value="true" />
+                            <property name="parentLoaderPriority" value="true" />
+                        </bean>
+                        <bean class="org.eclipse.jetty.webapp.WebAppContext">
                             <property name="contextPath" value="/demo" />
                             <property name="resourceBase" value="${activemq.home}/webapps-demo/demo"
/>
                             <property name="logUrlOnStart" value="true" />
                         </bean>
                         <bean class="org.eclipse.jetty.webapp.WebAppContext">
-                            <property name="contextPath" value="/fileserver" />
-                            <property name="resourceBase" value="${activemq.home}/webapps/fileserver"
/>
+                            <property name="contextPath" value="/api" />
+                            <property name="resourceBase" value="${activemq.home}/webapps/api"
/>
                             <property name="logUrlOnStart" value="true" />
-                            <property name="parentLoaderPriority" value="true" />
                         </bean>
                         <bean class="org.eclipse.jetty.server.handler.ResourceHandler">
                             <property name="directoriesListed" value="false" />
@@ -82,16 +104,33 @@
         </property>
     </bean>
 
+    <bean id="rewrite" class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
+      <property name="rules">
+          <set>
+              <bean class="org.eclipse.jetty.rewrite.handler.RedirectRegexRule">
+                  <property name="regex" value="/api/jolokia(.*)"/>
+                  <property name="replacement" value="/hawtio/jolokia$1"/>
+              </bean>
+          </set>
+      </property>
+    </bean>
+
     <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
@@ -110,6 +149,7 @@
             <bean id="handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
                 <property name="handlers">
                     <list>
+                        <ref bean="rewrite"/>
                         <ref bean="contexts" />
                         <ref bean="securityHandler" />
                     </list>
@@ -119,4 +159,4 @@
 
     </bean>
 
-</beans>
+</beans>
\ No newline at end of file


Mime
View raw message