[jboss-cvs] JBossAS SVN: r60855 - in branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat: service and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 23 16:10:48 EST 2007


Author: anil.saldhana at jboss.com
Date: 2007-02-23 16:10:47 -0500 (Fri, 23 Feb 2007)
New Revision: 60855

Modified:
   branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/security/JaccContextValve.java
   branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/service/TomcatDeployer.java
Log:
JBAS:4149: set metadata on jacc context valve

Modified: branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/security/JaccContextValve.java
===================================================================
--- branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/security/JaccContextValve.java	2007-02-23 21:10:02 UTC (rev 60854)
+++ branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/security/JaccContextValve.java	2007-02-23 21:10:47 UTC (rev 60855)
@@ -31,6 +31,7 @@
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.valves.ValveBase;
 import org.jboss.logging.Logger;
+import org.jboss.metadata.WebMetaData;
 
 /**
  * A Valve that sets the JACC context id and HttpServletRequest policy
@@ -44,12 +45,14 @@
 {
    private static Logger log = Logger.getLogger(JaccContextValve.class);
    public static ThreadLocal activeCS = new ThreadLocal();
+   public static ThreadLocal activeWebMetaData = new ThreadLocal();
 
    /** The web app metadata */
    private String contextID;
    /** The web app deployment code source */
    private CodeSource warCS;
    private boolean trace;
+   private WebMetaData webMetaData;
 
    public JaccContextValve(String contextID, CodeSource cs)
    {
@@ -57,11 +60,18 @@
       this.warCS = cs;
       this.trace = log.isTraceEnabled();
    }
+   
+   public void setWebMetaData(WebMetaData wmd)
+   {
+      this.webMetaData = wmd;
+   }
 
    public void invoke(Request request, Response response)
       throws IOException, ServletException
    {
       activeCS.set(warCS);
+      activeWebMetaData.set(webMetaData);
+      
       HttpServletRequest httpRequest = (HttpServletRequest) request.getRequest();
 
       try

Modified: branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/service/TomcatDeployer.java
===================================================================
--- branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/service/TomcatDeployer.java	2007-02-23 21:10:02 UTC (rev 60854)
+++ branches/Branch_4_2/tomcat/src/main/org/jboss/web/tomcat/service/TomcatDeployer.java	2007-02-23 21:10:47 UTC (rev 60855)
@@ -288,6 +288,9 @@
          new Object[]{jaccValve},
          new String[]{"org.apache.catalina.Valve"});
 
+      //Set the meta data on the JaccContextValve
+      jaccValve.setWebMetaData(metaData);
+      
       // Pass the metadata to the RunAsListener via a thread local
       RunAsListener.metaDataLocal.set(metaData);
 




More information about the jboss-cvs-commits mailing list