1 17 package org.apache.geronimo.tomcat.valve; 18 19 import org.apache.catalina.connector.Request; 20 import org.apache.catalina.connector.Response; 21 import org.apache.catalina.valves.ValveBase; 22 import org.apache.geronimo.naming.java.RootContext; 23 24 import javax.naming.Context ; 25 import javax.servlet.ServletException ; 26 import java.io.IOException ; 27 28 31 public class ComponentContextValve extends ValveBase { 32 33 private final Context componentContext; 34 35 public ComponentContextValve(Context context){ 36 componentContext = context; 37 } 38 39 public void invoke(Request request, Response response) throws IOException , ServletException { 40 41 Context oldContext = RootContext.getComponentContext(); 43 44 RootContext.setComponentContext(componentContext); 46 getNext().invoke(request, response); 48 49 RootContext.setComponentContext(oldContext); 51 } 52 } 53 | Popular Tags |