1 16 17 package org.apache.coyote.tomcat3; 18 19 import org.apache.coyote.Adapter; 20 import org.apache.tomcat.core.ContextManager; 21 import org.apache.tomcat.core.BaseInterceptor; 22 23 31 public class Tomcat3Adapter implements Adapter { 32 ContextManager cm; 33 BaseInterceptor connector; 34 35 Tomcat3Adapter(ContextManager ctxman, CoyoteInterceptor2 conn) { 36 cm = ctxman; 37 connector = conn; 38 } 39 40 static int containerRequestNOTE=1; 42 44 public void service(org.apache.coyote.Request request, 45 org.apache.coyote.Response response) 46 throws Exception 47 { 48 Tomcat3Request reqA; 49 Tomcat3Response resA; 50 51 reqA=(Tomcat3Request)request.getNote( containerRequestNOTE ); 52 if( reqA==null ) { 53 reqA=new Tomcat3Request(); 54 resA=new Tomcat3Response(); 55 cm.initRequest( reqA, resA ); 56 57 reqA.setCoyoteRequest(request); 58 resA.setCoyoteResponse(response); 59 reqA.setConnector(connector); 60 request.setNote( containerRequestNOTE, reqA ); 61 } else { 62 resA=(Tomcat3Response)reqA.getResponse(); 63 } 64 65 if( reqA.scheme().isNull() ) { 66 reqA.scheme().setString("http"); 67 } 68 try { 69 cm.service( reqA, resA ); 70 } finally { 71 reqA.recycle(); 72 resA.recycle(); 73 } 74 } 75 } 76 | Popular Tags |