geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r109916 - in geronimo/branches/djencks/jetty-deployer1/trunk/modules: jetty-builder/src/test/org/apache/geronimo/jetty/deployment jetty/src/java/org/apache/geronimo/jetty jetty/src/java/org/apache/geronimo/jetty/interceptor
Date Sun, 05 Dec 2004 22:12:28 GMT
Author: djencks
Date: Sun Dec  5 14:12:28 2004
New Revision: 109916

URL: http://svn.apache.org/viewcvs?view=rev&rev=109916
Log:
add missing BeforeAfter, sync with security changes
Added:
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/WebApplicationContextBeforeAfter.java
Modified:
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/BeforeAfter.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ComponentContextBeforeAfter.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ThreadClassloaderBeforeAfter.java
   geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/TransactionContextBeforeAfter.java

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?view=diff&rev=109916&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java&r1=109915&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java&r2=109916
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Sun Dec  5 14:12:28 2004
@@ -186,7 +186,7 @@
         kernel = new Kernel("test.kernel");
         kernel.boot();
         ObjectName defaultServlets = ObjectName.getInstance("test:name=test,type=none,*");
-        SecurityServiceImpl securityService = new SecurityServiceImpl("org.apache.geronimo.security.jacc.GeronimoPolicyConfigurationFactory");
+        SecurityServiceImpl securityService = new SecurityServiceImpl("org.apache.geronimo.security.jacc.GeronimoPolicyConfigurationFactory",
null, null);
 
         builder = new JettyModuleBuilder(new URI("null"), new Integer(1800), Collections.EMPTY_LIST,
containerName, defaultServlets, securityService, kernel);
 

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?view=diff&rev=109916&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java&r1=109915&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java&r2=109916
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Sun Dec  5 14:12:28 2004
@@ -37,6 +37,7 @@
 import org.apache.geronimo.jetty.interceptor.InstanceContextBeforeAfter;
 import org.apache.geronimo.jetty.interceptor.ThreadClassloaderBeforeAfter;
 import org.apache.geronimo.jetty.interceptor.TransactionContextBeforeAfter;
+import org.apache.geronimo.jetty.interceptor.WebApplicationContextBeforeAfter;
 import org.apache.geronimo.naming.java.ReadOnlyContext;
 import org.apache.geronimo.transaction.OnlineUserTransaction;
 import org.apache.geronimo.transaction.TrackedConnectionAssociator;
@@ -156,19 +157,21 @@
         BeforeAfter interceptor = new InstanceContextBeforeAfter(null, index++, unshareableResources,
applicationManagedSecurityResources, trackedConnectionAssociator);
         interceptor = new TransactionContextBeforeAfter(interceptor, index++, index++, transactionContextManager);
         interceptor = new ComponentContextBeforeAfter(interceptor, index++, componentContext);
-        chain = new ThreadClassloaderBeforeAfter(interceptor, index++, index++, this.classLoader);
+        interceptor = new ThreadClassloaderBeforeAfter(interceptor, index++, index++, this.classLoader);
+        interceptor = new WebApplicationContextBeforeAfter(interceptor, index++, this);
+        chain = interceptor;
         contextLength = index;
     }
 
-    public Object enterContextScope(HttpRequest request, HttpResponse response) {
+    public Object enterContextScope(HttpRequest httpRequest, HttpResponse httpResponse) {
         Object[] context = new Object[contextLength];
-        chain.before(context);
+        chain.before(context, httpRequest, httpResponse);
         return context;
     }
 
-    public void leaveContextScope(HttpRequest request, HttpResponse response, Object oldScope)
{
+    public void leaveContextScope(HttpRequest httpRequest, HttpResponse httpResponse, Object
oldScope) {
         Object[] context = (Object[]) oldScope;
-        chain.after(context);
+        chain.after(context, httpRequest, httpResponse);
     }
 
     public void doStart() throws WaitingException, Exception {

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/BeforeAfter.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/BeforeAfter.java?view=diff&rev=109916&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/BeforeAfter.java&r1=109915&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/BeforeAfter.java&r2=109916
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/BeforeAfter.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/BeforeAfter.java
Sun Dec  5 14:12:28 2004
@@ -16,13 +16,16 @@
  */
 package org.apache.geronimo.jetty.interceptor;
 
+import org.mortbay.http.HttpRequest;
+import org.mortbay.http.HttpResponse;
+
 /**
  * @version $Rev:  $ $Date:  $
  */
 public interface BeforeAfter {
 
-    void before(Object[] context);
+    void before(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse);
 
-    void after(Object[] context);
+    void after(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse);
 
 }

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ComponentContextBeforeAfter.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ComponentContextBeforeAfter.java?view=diff&rev=109916&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ComponentContextBeforeAfter.java&r1=109915&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ComponentContextBeforeAfter.java&r2=109916
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ComponentContextBeforeAfter.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ComponentContextBeforeAfter.java
Sun Dec  5 14:12:28 2004
@@ -18,6 +18,8 @@
 
 import org.apache.geronimo.naming.java.ReadOnlyContext;
 import org.apache.geronimo.naming.java.RootContext;
+import org.mortbay.http.HttpRequest;
+import org.mortbay.http.HttpResponse;
 
 /**
  * @version $Rev:  $ $Date:  $
@@ -34,17 +36,17 @@
         this.readOnlyContext = readOnlyContext;
     }
 
-    public void before(Object[] context) {
+    public void before(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
         context[index] = RootContext.getComponentContext();
         RootContext.setComponentContext(readOnlyContext);
         if (next != null) {
-            next.before(context);
+            next.before(context, httpRequest, httpResponse);
         }
     }
 
-    public void after(Object[] context) {
+    public void after(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
         if (next != null) {
-            next.after(context);
+            next.after(context, httpRequest, httpResponse);
         }
         RootContext.setComponentContext((ReadOnlyContext) context[index]);
     }

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java?view=diff&rev=109916&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java&r1=109915&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java&r2=109916
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java
Sun Dec  5 14:12:28 2004
@@ -22,6 +22,8 @@
 import org.apache.geronimo.transaction.DefaultInstanceContext;
 import org.apache.geronimo.transaction.InstanceContext;
 import org.apache.geronimo.transaction.TrackedConnectionAssociator;
+import org.mortbay.http.HttpRequest;
+import org.mortbay.http.HttpResponse;
 
 /**
  * @version $Rev:  $ $Date:  $
@@ -42,20 +44,20 @@
         this.trackedConnectionAssociator = trackedConnectionAssociator;
     }
 
-    public void before(Object[] context) {
+    public void before(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
         try {
             context[index] = trackedConnectionAssociator.enter(new DefaultInstanceContext(unshareableResources,
applicationManagedSecurityResources));
         } catch (ResourceException e) {
             throw new RuntimeException(e);
         }
         if (next != null) {
-            next.before(context);
+            next.before(context, httpRequest, httpResponse);
         }
     }
 
-    public void after(Object[] context) {
+    public void after(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
         if (next != null) {
-            next.after(context);
+            next.after(context, httpRequest, httpResponse);
         }
         try {
             trackedConnectionAssociator.exit((InstanceContext) context[index]);

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java?view=diff&rev=109916&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java&r1=109915&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java&r2=109916
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
Sun Dec  5 14:12:28 2004
@@ -35,6 +35,8 @@
 import org.apache.geronimo.security.deploy.Security;
 import org.apache.geronimo.security.jacc.RoleMappingConfiguration;
 import org.apache.geronimo.security.util.ConfigurationUtil;
+import org.mortbay.http.HttpRequest;
+import org.mortbay.http.HttpResponse;
 
 /**
  * @version $Rev:  $ $Date:  $
@@ -55,7 +57,7 @@
         this.policyContextID = policyContextID;
     }
 
-    public void before(Object[] context) {
+    public void before(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
         context[policyContextIDIndex] = PolicyContext.getContextID();
         context[webAppContextIndex] = getCurrentSecurityInterceptor();
 
@@ -63,13 +65,13 @@
         setCurrentSecurityInterceptor(this);
 
         if (next != null) {
-            next.before(context);
+            next.before(context, httpRequest, httpResponse);
         }
     }
 
-    public void after(Object[] context) {
+    public void after(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
         if (next != null) {
-            next.after(context);
+            next.after(context, httpRequest, httpResponse);
         }
         setCurrentSecurityInterceptor((SecurityContextBeforeAfter) context[webAppContextIndex]);
         PolicyContext.setContextID((String) context[policyContextIDIndex]);

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ThreadClassloaderBeforeAfter.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ThreadClassloaderBeforeAfter.java?view=diff&rev=109916&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ThreadClassloaderBeforeAfter.java&r1=109915&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ThreadClassloaderBeforeAfter.java&r2=109916
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ThreadClassloaderBeforeAfter.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/ThreadClassloaderBeforeAfter.java
Sun Dec  5 14:12:28 2004
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.jetty.interceptor;
 
+import org.mortbay.http.HttpRequest;
+import org.mortbay.http.HttpResponse;
 
 
 /**
@@ -35,19 +37,19 @@
         this.classLoader = classLoader;
     }
 
-    public void before(Object[] context) {
+    public void before(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
         Thread thread = Thread.currentThread();
         context[threadIndex] = thread;
         context[classLoaderIndex] = thread.getContextClassLoader();
         thread.setContextClassLoader(classLoader);
         if (next != null) {
-            next.before(context);
+            next.before(context, httpRequest, httpResponse);
         }
     }
 
-    public void after(Object[] context) {
+    public void after(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
         if (next != null) {
-            next.after(context);
+            next.after(context, httpRequest, httpResponse);
         }
         ((Thread)context[threadIndex]).setContextClassLoader((ClassLoader)context[classLoaderIndex]);
     }

Modified: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/TransactionContextBeforeAfter.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/TransactionContextBeforeAfter.java?view=diff&rev=109916&p1=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/TransactionContextBeforeAfter.java&r1=109915&p2=geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/TransactionContextBeforeAfter.java&r2=109916
==============================================================================
--- geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/TransactionContextBeforeAfter.java
(original)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/TransactionContextBeforeAfter.java
Sun Dec  5 14:12:28 2004
@@ -24,6 +24,8 @@
 import org.apache.geronimo.transaction.context.InheritableTransactionContext;
 import org.apache.geronimo.transaction.context.TransactionContext;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.mortbay.http.HttpRequest;
+import org.mortbay.http.HttpResponse;
 
 /**
  * @version $Rev:  $ $Date:  $
@@ -42,7 +44,7 @@
         this.transactionContextManager = transactionContextManager;
     }
 
-    public void before(Object[] context) {
+    public void before(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
         TransactionContext oldTransactionContext = transactionContextManager.getContext();
         TransactionContext newTransactionContext = null;
         if (oldTransactionContext == null || !(oldTransactionContext instanceof InheritableTransactionContext))
{
@@ -52,13 +54,13 @@
         context[newTxIndex] = newTransactionContext;
 
         if (next != null) {
-            next.before(context);
+            next.before(context, httpRequest, httpResponse);
         }
     }
 
-    public void after(Object[] context) {
+    public void after(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
         if (next != null) {
-            next.after(context);
+            next.after(context, httpRequest, httpResponse);
         }
         TransactionContext oldTransactionContext = (TransactionContext) context[oldTxIndex];
         TransactionContext newTransactionContext = (TransactionContext) context[newTxIndex];

Added: geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/WebApplicationContextBeforeAfter.java
Url: http://svn.apache.org/viewcvs/geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/WebApplicationContextBeforeAfter.java?view=auto&rev=109916
==============================================================================
--- (empty file)
+++ geronimo/branches/djencks/jetty-deployer1/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/WebApplicationContextBeforeAfter.java
Sun Dec  5 14:12:28 2004
@@ -0,0 +1,57 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.jetty.interceptor;
+
+import org.mortbay.http.HttpRequest;
+import org.mortbay.http.HttpResponse;
+import org.mortbay.http.HttpContext;
+import org.apache.geronimo.jetty.JettyWebAppContext;
+
+/**
+ * @version $Rev:  $ $Date:  $
+ */
+public class WebApplicationContextBeforeAfter implements BeforeAfter {
+
+    private final BeforeAfter next;
+    private final int index;
+    private final JettyWebAppContext webAppContext;
+
+    public WebApplicationContextBeforeAfter(BeforeAfter next, int index, JettyWebAppContext
webAppContext) {
+        this.next = next;
+        this.index = index;
+        this.webAppContext = webAppContext;
+    }
+
+    public void before(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
+        if (httpResponse != null) {
+            context[index] = httpResponse.getHttpContext();
+            httpResponse.setHttpContext(webAppContext);
+        }
+        if (next != null) {
+            next.before(context, httpRequest, httpResponse);
+        }
+    }
+
+    public void after(Object[] context, HttpRequest httpRequest, HttpResponse httpResponse)
{
+        if (next != null) {
+            next.after(context, httpRequest, httpResponse);
+        }
+        if (httpResponse != null) {
+            httpResponse.setHttpContext((HttpContext) context[index]);
+        }
+    }
+}

Mime
View raw message