geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r151572 - geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/valve/PolicyContextValve.java
Date Sun, 06 Feb 2005 11:18:09 GMT
Author: jgenender
Date: Sun Feb  6 03:18:07 2005
New Revision: 151572

URL: http://svn.apache.org/viewcvs?view=rev&rev=151572
Log:
Added valve to handle policy context

Added:
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/valve/PolicyContextValve.java

Added: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/valve/PolicyContextValve.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/valve/PolicyContextValve.java?view=auto&rev=151572
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/valve/PolicyContextValve.java
(added)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/valve/PolicyContextValve.java
Sun Feb  6 03:18:07 2005
@@ -0,0 +1,37 @@
+package org.apache.geronimo.tomcat.valve;
+
+import org.apache.catalina.valves.ValveBase;
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+
+import javax.servlet.ServletException;
+import javax.security.jacc.PolicyContext;
+import java.io.IOException;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: jeffgenender
+ * Date: Feb 5, 2005
+ * Time: 6:00:02 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class PolicyContextValve extends ValveBase{
+
+    private final String policyContextID;
+
+    public PolicyContextValve(String policyContextID){
+        this.policyContextID = policyContextID;
+    }
+
+    public void invoke(Request request, Response response) throws IOException, ServletException
{
+
+        String oldId = PolicyContext.getContextID();
+
+        PolicyContext.setContextID(policyContextID);
+
+        // Pass this request on to the next valve in our pipeline
+        getNext().invoke(request, response);
+
+        PolicyContext.setContextID(oldId);
+    }
+}



Mime
View raw message