You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2009/09/17 20:56:36 UTC

svn commit: r816335 - in /ofbiz/trunk/framework: base/dtd/ofbiz-component.xsd base/src/org/ofbiz/base/component/ComponentConfig.java catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java

Author: jleroux
Date: Thu Sep 17 18:56:36 2009
New Revision: 816335

URL: http://svn.apache.org/viewvc?rev=816335&view=rev
Log:
A patch from Brett Palmer "Adding Tomcat Catalina configuration for "privileged" applications" (https://issues.apache.org/jira/browse/OFBIZ-2945) - OFBIZ-2945

Out of the box Tomcat allows you to configure "privileged" applications by specifying the context as follows.
<Context path="/manager" debug="0" privileged="true"
   docBase="/usr/local/kinetic/tomcat6/server/webapps/manager">
</Context>

Since OFBiz is an embedded version of Tomcat it does not currently include a similar configuration for privileged applications.

The Tomcat manager application is a "privileged" application that includes utilities for monitoring JMX resources such as thread counts, connections, and any other configured JMX parameter. We use JMX with Hyperic to monitor our OFBiz servers

BTW, I used almost the same for Lambda Probe (https://issues.apache.org/jira/browse/OFBIZ-1397)

Modified:
    ofbiz/trunk/framework/base/dtd/ofbiz-component.xsd
    ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java
    ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java

Modified: ofbiz/trunk/framework/base/dtd/ofbiz-component.xsd
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/dtd/ofbiz-component.xsd?rev=816335&r1=816334&r2=816335&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/dtd/ofbiz-component.xsd (original)
+++ ofbiz/trunk/framework/base/dtd/ofbiz-component.xsd Thu Sep 17 18:56:36 2009
@@ -191,6 +191,14 @@
         <xs:attribute type="xs:string" name="base-permission">
             <xs:annotation><xs:documentation>A user must have ALL of the permissions in the list to access the application</xs:documentation></xs:annotation>
         </xs:attribute>
+        <xs:attribute name="privileged" default="false">
+            <xs:simpleType>
+                <xs:restriction base="xs:token">
+                    <xs:enumeration value="true"/>
+                    <xs:enumeration value="false"/>
+                </xs:restriction>
+            </xs:simpleType>
+        </xs:attribute>
         <xs:attribute name="app-bar-display" default="true">
             <xs:simpleType>
                 <xs:restriction base="xs:token">

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java?rev=816335&r1=816334&r2=816335&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/component/ComponentConfig.java Thu Sep 17 18:56:36 2009
@@ -688,6 +688,7 @@
         public String position;
         public boolean appBarDisplay;
         public boolean sessionCookieAccepted;
+        public boolean privileged;
 
         public WebappInfo(ComponentConfig componentConfig, Element element) {
             this.virtualHosts = FastList.newInstance();
@@ -701,6 +702,7 @@
             this.location = element.getAttribute("location");
             this.appBarDisplay = !"false".equals(element.getAttribute("app-bar-display"));
             this.sessionCookieAccepted = !"false".equals(element.getAttribute("session-cookie-accepted"));
+            this.privileged = !"false".equals(element.getAttribute("privileged"));
             String basePermStr = element.getAttribute("base-permission");
             if (UtilValidate.isNotEmpty(basePermStr)) {
                 this.basePermission = basePermStr.split(",");

Modified: ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java?rev=816335&r1=816334&r2=816335&view=diff
==============================================================================
--- ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java (original)
+++ ofbiz/trunk/framework/catalina/src/org/ofbiz/catalina/container/CatalinaContainer.java Thu Sep 17 18:56:36 2009
@@ -550,6 +550,7 @@
         context.setReloadable(contextReloadable);
         context.setDistributable(distribute);
         context.setCrossContext(crossContext);
+        context.setPrivileged(appInfo.privileged);
         context.setManager(sessionMgr);
         context.getServletContext().setAttribute("_serverId", appInfo.server);
         context.getServletContext().setAttribute("componentName", appInfo.componentConfig.getComponentName());