You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@locus.apache.org on 2000/11/02 22:45:16 UTC
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/task ApacheConfig.java StartTomcat.java StopTomcat.java
costin 00/11/02 13:45:12
Modified: src/share/org/apache/tomcat/context
LoadOnStartupInterceptor.java
src/share/org/apache/tomcat/core Handler.java
OutputBuffer.java Response.java
src/share/org/apache/tomcat/helper ServerXmlHelper.java
SessionUtil.java
src/share/org/apache/tomcat/modules/server Ajp12.java
Ajp13.java Http10Interceptor.java
src/share/org/apache/tomcat/request AccessInterceptor.java
InvokerInterceptor.java ReloadInterceptor.java
SessionInterceptor.java SimpleMapper1.java
StaticInterceptor.java
src/share/org/apache/tomcat/service/connector
Ajp12ConnectionHandler.java
Ajp13ConnectorRequest.java
src/share/org/apache/tomcat/service/http
HttpConnectionHandler.java HttpInterceptor.java
src/share/org/apache/tomcat/session
ServerSessionManager.java
src/share/org/apache/tomcat/startup EmbededTomcat.java
Main.java
src/share/org/apache/tomcat/task ApacheConfig.java
StartTomcat.java StopTomcat.java
Log:
Fixes to support the core changes:
- support the String->MessageBytes change in Request
- Interceptors are part of container, not ContextManager
- respect the server and webapp state.
Also:
- simplify ServerXml reader ( using the improved XmlMapper )
Revision Changes Path
1.26 +8 -5 jakarta-tomcat/src/share/org/apache/tomcat/context/LoadOnStartupInterceptor.java
Index: LoadOnStartupInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/LoadOnStartupInterceptor.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- LoadOnStartupInterceptor.java 2000/09/29 07:00:56 1.25
+++ LoadOnStartupInterceptor.java 2000/11/02 21:44:36 1.26
@@ -114,14 +114,17 @@
for (int i = 0; i < orderedKeys.size(); i ++) {
Integer key = (Integer)orderedKeys.elementAt(i);
- Enumeration sOnLevel = ((Vector)loadableServlets.get( key )).elements();
+ Enumeration sOnLevel = ((Vector)loadableServlets.get( key )).
+ elements();
while (sOnLevel.hasMoreElements()) {
String servletName = (String)sOnLevel.nextElement();
Handler result = ctx.getServletByName(servletName);
- if( ctx.getDebug() > 0 ) ctx.log("Loading " + key + " " + servletName );
+ if( ctx.getDebug() > 0 )
+ ctx.log("Loading " + key + " " + servletName );
if(result==null)
- log("Warning: we try to load an undefined servlet " + servletName, Logger.WARNING);
+ log("Warning: we try to load an undefined servlet " +
+ servletName, Logger.WARNING);
else {
try {
if( result.getPath() != null )
@@ -157,8 +160,8 @@
String requestURI = path + "?jsp_precompile=true";
- request.setRequestURI(context.getPath() + path);
- request.setQueryString( "jsp_precompile=true" );
+ request.requestURI().setString(context.getPath() + path);
+ request.queryString().setString( "jsp_precompile=true" );
request.setContext(context);
1.20 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java
Index: Handler.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Handler.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- Handler.java 2000/10/01 22:21:44 1.19
+++ Handler.java 2000/11/02 21:44:37 1.20
@@ -312,7 +312,7 @@
}
BaseInterceptor reqI[]=
- contextM.getInterceptors(req, Container.H_postService);
+ req.getContainer().getInterceptors(Container.H_postService);
if( ! internal ) {
for( int i=0; i< reqI.length; i++ ) {
1.8 +2 -2 jakarta-tomcat/src/share/org/apache/tomcat/core/OutputBuffer.java
Index: OutputBuffer.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/OutputBuffer.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- OutputBuffer.java 2000/10/06 05:18:13 1.7
+++ OutputBuffer.java 2000/11/02 21:44:37 1.8
@@ -127,8 +127,8 @@
// If we really have something to write
if( cnt>0 ) {
// call the beforeCommit callback
- BaseInterceptor reqI[]= cm.getInterceptors(req,
- Container.H_beforeCommit);
+ BaseInterceptor reqI[]= req.getContainer().
+ getInterceptors(Container.H_beforeCommit);
for( int i=0; i< reqI.length; i++ ) {
reqI[i].beforeCommit( req, res );
}
1.41 +4 -4 jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java
Index: Response.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- Response.java 2000/10/01 22:21:45 1.40
+++ Response.java 2000/11/02 21:44:37 1.41
@@ -227,8 +227,8 @@
public void finish() throws IOException {
oBuffer.close();
ContextManager cm=request.getContextManager();
- BaseInterceptor reqI[]= cm.
- getInterceptors(request, Container.H_afterBody);
+ BaseInterceptor reqI[]= request.getContainer().
+ getInterceptors(Container.H_afterBody);
for( int i=0; i< reqI.length; i++ ) {
reqI[i].afterBody( request, this );
@@ -312,8 +312,8 @@
// call before body hooks
ContextManager cm=request.getContext().getContextManager();
- BaseInterceptor reqI[]= cm.
- getInterceptors(request, Container.H_beforeBody);
+ BaseInterceptor reqI[]= request.getContainer().
+ getInterceptors(Container.H_beforeBody);
for( int i=0; i< reqI.length; i++ ) {
reqI[i].beforeBody( request, this );
1.7 +55 -53 jakarta-tomcat/src/share/org/apache/tomcat/helper/ServerXmlHelper.java
Index: ServerXmlHelper.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/helper/ServerXmlHelper.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ServerXmlHelper.java 2000/10/01 06:37:49 1.6
+++ ServerXmlHelper.java 2000/11/02 21:44:38 1.7
@@ -87,6 +87,12 @@
public void setHelper( XmlMapper xh ) {
xh.addRule( "ContextManager", xh.setProperties() );
+ setInterceptorRules( xh );
+ setContextRules( xh );
+ setVHostRules( xh );
+ }
+
+ public static void setInterceptorRules( XmlMapper xh ) {
xh.addRule( "ContextManager/ContextInterceptor",
xh.objectCreate(null, "className"));
xh.addRule( "ContextManager/ContextInterceptor",
@@ -106,68 +112,57 @@
xh.addRule( "ContextManager/RequestInterceptor",
xh.addChild( "addInterceptor",
"org.apache.tomcat.core.BaseInterceptor"));
-
+ }
+
+ public static void setContextRules( XmlMapper xh ) {
// Default host
- xh.addRule( "ContextManager/Context",
+ xh.addRule( "Context",
xh.objectCreate("org.apache.tomcat.core.Context"));
- xh.addRule( "ContextManager/Context",
- xh.setParent( "setContextManager") );
- xh.addRule( "ContextManager/Context",
+ xh.addRule( "Context",
xh.setProperties() );
- xh.addRule( "ContextManager/Context",
- xh.addChild( "addContext", null ) );
- xh.addRule( "ContextManager/Context/RequestInterceptor",
+ xh.addRule( "Context",
+ xh.setParent("setContextManager") );
+
+ xh.addRule( "Context", new XmlAction() {
+ public void end( SaxContext ctx) throws Exception {
+ Context tcCtx=(Context)ctx.currentObject();
+ String host=(String)ctx.getVariable("current_host");
+
+ if( host!=null && ! "DEFAULT".equals( host ))
+ tcCtx.setHost( host );
+ }
+ });
+
+ xh.addRule( "Context",
+ xh.addChild("addContext",
+ "org.apache.tomcat.core.Context") );
+
+ // Configure context interceptors
+ xh.addRule( "Context/Interceptor",
xh.objectCreate(null, "className"));
- xh.addRule( "ContextManager/Context/RequestInterceptor",
+ xh.addRule( "Context/Interceptor",
xh.setProperties() );
- xh.addRule( "ContextManager/Context/RequestInterceptor",
+ xh.addRule( "Context/Interceptor",
xh.setParent("setContext") );
- xh.addRule( "ContextManager/Context/RequestInterceptor",
+ xh.addRule( "Context/Interceptor",
xh.addChild( "addInterceptor",
"org.apache.tomcat.core.BaseInterceptor"));
-
- // Virtual host support.
- // Push a host object on the stack
- xh.addRule( "ContextManager/Host", new XmlAction() {
- public void start( SaxContext ctx) throws Exception {
- Stack st=ctx.getObjectStack();
- // get attributes
- int top=ctx.getTagCount()-1;
- AttributeList attributes = ctx.getAttributeList( top );
-
- // get CM
- ContextManager cm=(ContextManager)st.peek();
-
- // construct virtual host config helper
- HostConfig hc=new HostConfig(cm);
-
- // set the host name
- hc.setName( attributes.getValue("name"));
- st.push( hc );
- }
- public void cleanup( SaxContext ctx) {
- Stack st=ctx.getObjectStack();
- Object o=st.pop();
- }
- });
- xh.addRule( "ContextManager/Host", xh.setProperties());
-
- xh.addRule( "ContextManager/Host/Context",
- xh.objectCreate("org.apache.tomcat.core.Context"));
- xh.addRule( "ContextManager/Host/Context",
+ // Old style
+ xh.addRule( "Context/RequestInterceptor",
+ xh.objectCreate(null, "className"));
+ xh.addRule( "Context/RequestInterceptor",
xh.setProperties() );
- xh.addRule( "ContextManager/Host/Context", new XmlAction() {
- public void end( SaxContext ctx) throws Exception {
- Stack st=ctx.getObjectStack();
-
- Context tcCtx=(Context)st.pop(); // get the Context
- HostConfig hc=(HostConfig)st.peek();
- st.push( tcCtx );
- // put back the context, to be cleaned up corectly
-
- hc.addContext( tcCtx );
- }
- });
+ xh.addRule( "Context/RequestInterceptor",
+ xh.setParent("setContext") );
+ xh.addRule( "Context/RequestInterceptor",
+ xh.addChild( "addInterceptor",
+ "org.apache.tomcat.core.BaseInterceptor"));
+ }
+
+ // Virtual host support.
+ public static void setVHostRules( XmlMapper xh ) {
+ xh.addRule( "Host", xh.setVariable( "current_host", "name"));
+ xh.addRule( "Host", xh.setProperties());
}
public void setConnectorHelper( XmlMapper xh ) {
@@ -195,6 +190,10 @@
* *** [I don't think that's true any more -Alex]
*/
public void setLogHelper( XmlMapper xh ) {
+ setLogRules( xh );
+ }
+
+ public static void setLogRules( XmlMapper xh ) {
xh.addRule("Server/Logger",
xh.objectCreate("org.apache.tomcat.util.log.QueueLogger"));
xh.addRule("Server/Logger", xh.setProperties());
@@ -272,4 +271,7 @@
return false;
}
}
+
+ // -------------------- Deprecated --------------------
+
}
1.3 +1 -12 jakarta-tomcat/src/share/org/apache/tomcat/helper/SessionUtil.java
Index: SessionUtil.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/helper/SessionUtil.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SessionUtil.java 2000/09/25 07:20:31 1.2
+++ SessionUtil.java 2000/11/02 21:44:41 1.3
@@ -1,8 +1,4 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/helper/SessionUtil.java,v 1.2 2000/09/25 07:20:31 costin Exp $
- * $Revision: 1.2 $
- * $Date: 2000/09/25 07:20:31 $
- *
* ====================================================================
*
* The Apache Software License, Version 1.1
@@ -72,7 +68,7 @@
* <code>Session</code> implementations.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.2 $ $Date: 2000/09/25 07:20:31 $
+ * @version $Revision: 1.3 $ $Date: 2000/11/02 21:44:41 $
*/
public final class SessionUtil {
@@ -144,13 +140,6 @@
else
return (url);
- }
-
- /**
- * Generate and return a new session identifier.
- */
- public static String generateSessionId() {
- return SessionIdGenerator.generateId();
}
/**
1.6 +10 -9 jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12.java
Index: Ajp12.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Ajp12.java 2000/10/08 21:28:57 1.5
+++ Ajp12.java 2000/11/02 21:44:47 1.6
@@ -116,7 +116,7 @@
break;
case 1: //beginning of request
- req.setMethod( readString(ajpin, null));
+ req.method().setString( readString(ajpin, null));
//Zone
String contextPath = readString(ajpin, null);
@@ -142,15 +142,15 @@
req.setPathInfo( readString(ajpin, null));
//Apache parsed path-translated XXX Bug in mod_jserv !!!!!
dummy = readString(ajpin, null);
- req.setQueryString( readString(ajpin, null));
+ req.queryString().setString( readString(ajpin, null));
req.setRemoteAddr(readString(ajpin, ""));
req.setRemoteHost( readString(ajpin, ""));
req.setRemoteUser( readString(ajpin, null));
req.setAuthType(readString(ajpin, null));
//remote port
dummy = readString(ajpin, null);
- req.setMethod( readString(ajpin, null));
- req.setRequestURI( readString(ajpin, ""));
+ req.method().setString( readString(ajpin, null));
+ req.requestURI().setString( readString(ajpin, ""));
// XXX don't set lookup path - problems with URL rewriting.
// need to be fixed.
@@ -209,7 +209,7 @@
*/
req.setAttribute(token1, token2);
if(token1.equals("HTTPS") && token2.equals("on")) {
- req.setScheme("https");
+ req.scheme().setString("https");
}
break;
@@ -282,13 +282,14 @@
}
// REQUEST_URI may includes query string
- String requestURI=req.getRequestURI();
+ String requestURI=req.requestURI().toString();
int indexQ=requestURI.indexOf("?");
int rLen=requestURI.length();
if ( (indexQ >-1) && ( indexQ < rLen) ) {
- req.setQueryString( requestURI.substring(indexQ + 1,
- requestURI.length()));
- req.setRequestURI( requestURI.substring(0, indexQ));
+ req.queryString().
+ setString( requestURI.substring(indexQ + 1,
+ requestURI.length()));
+ req.requestURI().setString( requestURI.substring(0, indexQ));
}
}
1.3 +4 -4 jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13.java
Index: Ajp13.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp13.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Ajp13.java 2000/09/24 18:09:53 1.2
+++ Ajp13.java 2000/11/02 21:44:47 1.3
@@ -187,9 +187,9 @@
* Read the method and translate it to a String
*/
bsc = msg.getByte();
- req.setMethod( methodTransArray[(int)bsc - 1] );
+ req.method().setString( methodTransArray[(int)bsc - 1] );
req.setProtocol( msg.getString());
- req.setRequestURI( msg.getString());
+ req.requestURI().setString( msg.getString());
req.setRemoteAddr( msg.getString());
req.setRemoteHost( msg.getString());
@@ -243,7 +243,7 @@
break;
case SC_A_QUERY_STRING :
- req.setQueryString( msg.getString());
+ req.queryString().setString( msg.getString());
break;
case SC_A_JVM_ROUTE :
@@ -279,7 +279,7 @@
}
if(isSSL) {
- req.setScheme("https");
+ req.scheme().setString("https");
}
MessageBytes clB=headers.getValue("content-length");
1.5 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java
Index: Http10Interceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Http10Interceptor.java 2000/10/06 05:18:53 1.4
+++ Http10Interceptor.java 2000/11/02 21:44:47 1.5
@@ -136,7 +136,7 @@
reqA.readNextRequest(resA);
if( secure ) {
- reqA.setScheme( "https" );
+ reqA.scheme().setString( "https" );
}
cm.service( reqA, resA );
1.22 +7 -6 jakarta-tomcat/src/share/org/apache/tomcat/request/AccessInterceptor.java
Index: AccessInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/AccessInterceptor.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- AccessInterceptor.java 2000/09/26 04:58:27 1.21
+++ AccessInterceptor.java 2000/11/02 21:44:50 1.22
@@ -239,10 +239,10 @@
getNote( secMapNote );
if( ctxSec.patterns==0 ) return 0; // fast exit
- String reqURI = RequestUtil.URLDecode(req.getRequestURI());
+ String reqURI = RequestUtil.URLDecode(req.requestURI().toString());
String ctxPath= ctx.getPath();
String path=reqURI.substring( ctxPath.length());
- String method=req.getMethod();
+ String method=req.method().toString();
if( debug > 1 ) log( "checking " + path );
@@ -412,13 +412,14 @@
return;
}
- String originalLocation = req.getRequestURI();
- if (req.getQueryString() != null)
- originalLocation += "?" + req.getQueryString();
+ String originalLocation = req.requestURI().toString();
+ if (req.queryString().toString() != null)
+ originalLocation += "?" + req.queryString().toString();
session.setAttribute( "tomcat.auth.originalLocation",
originalLocation);
if( debug > 0 )
- log("Redirect1: " + page + " originalUri=" + req.getRequestURI());
+ log("Redirect1: " + page + " originalUri=" +
+ req.requestURI().toString());
req.setAttribute("javax.servlet.error.message",
page );
1.14 +3 -3 jakarta-tomcat/src/share/org/apache/tomcat/request/InvokerInterceptor.java
Index: InvokerInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/InvokerInterceptor.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- InvokerInterceptor.java 2000/09/29 07:01:21 1.13
+++ InvokerInterceptor.java 2000/11/02 21:44:50 1.14
@@ -83,7 +83,7 @@
// log( "Ct: " + ct.getHandler() + " " +
// ct.getPath() + " " + ct.getMapType());
- if( req.getWrapper()!=null &&
+ if( req.getHandler()!=null &&
ct!=null &&
ct.getMapType() != Container.DEFAULT_MAP )
return 0;
@@ -131,7 +131,7 @@
Handler wrapper = ctx.getServletByName(servletName);
if (wrapper != null) {
- req.setWrapper( wrapper );
+ req.setHandler( wrapper );
return 0;
}
@@ -162,7 +162,7 @@
return 404;
}
- req.setWrapper( wrapper );
+ req.setHandler( wrapper );
return 0;
}
1.8 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/request/ReloadInterceptor.java
Index: ReloadInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/ReloadInterceptor.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ReloadInterceptor.java 2000/10/01 22:21:45 1.7
+++ ReloadInterceptor.java 2000/11/02 21:44:50 1.8
@@ -182,7 +182,7 @@
if( debug>0 ) log( "Reloading hooks for context " + ctx.toString());
// Call reload hook in context manager
- BaseInterceptor cI[]=cm.getInterceptors(ctx.getContainer());
+ BaseInterceptor cI[]=ctx.getContainer().getInterceptors();
for( int i=0; i< cI.length; i++ ) {
cI[i].reload( request, ctx );
}
1.29 +2 -2 jakarta-tomcat/src/share/org/apache/tomcat/request/SessionInterceptor.java
Index: SessionInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/SessionInterceptor.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- SessionInterceptor.java 2000/09/25 07:20:52 1.28
+++ SessionInterceptor.java 2000/11/02 21:44:50 1.29
@@ -112,7 +112,7 @@
// fix URL rewriting
String sig=";jsessionid=";
int foundAt=-1;
- String uri=request.getRequestURI();
+ String uri=request.requestURI().toString();
String sessionId;
if ((foundAt=uri.indexOf(sig))!=-1){
@@ -121,7 +121,7 @@
sessionId = fixSessionId( request, sessionId );
// rewrite URL, do I need to do anything more?
- request.setRequestURI(uri.substring(0, foundAt));
+ request.requestURI().setString(uri.substring(0, foundAt));
// No validate now - we just note that this is what the user
// requested.
1.24 +10 -8 jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleMapper1.java
Index: SimpleMapper1.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/SimpleMapper1.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- SimpleMapper1.java 2000/10/06 10:05:47 1.23
+++ SimpleMapper1.java 2000/11/02 21:44:51 1.24
@@ -245,7 +245,7 @@
/** First step of request porcessing is finding the Context.
*/
public int contextMap( Request req ) {
- String path = req.getRequestURI();
+ String path = req.requestURI().toString();
if( path==null)
throw new RuntimeException("ASSERT: null path in request URI");
if( path.indexOf("?") >=0 )
@@ -320,19 +320,19 @@
}
if(debug>0) log("SM: After mapping " + req + " " +
- req.getWrapper());
+ req.getHandler());
} catch(Exception ex ) {
log("Mapping " + req, ex);
return 500;
}
- return OK;
+ return 0;
}
/** No need to do that - we finished everything in the first step.
*
*/
- public int requestMap(Request req) {
+ // public int requestMap(Request req) {
// No op. All mapping is done in the first step - it's better because
// the alghoritm is more efficient. The only case where those 2 are
// not called togheter is in getContext( "path" ).
@@ -342,8 +342,8 @@
// is _allways_ called after contextMap ( it was asserted in all
// implementations).
- return OK;
- }
+ // return 0;
+ // }
// -------------------- Implementation methods --------------------
@@ -388,7 +388,9 @@
/** Adjust the paths in request after matching a container
*/
- void fixRequestPaths( String path, Request req, Container container ) throws Exception{
+ void fixRequestPaths( String path, Request req, Container container )
+ throws Exception
+ {
// Set servlet path and path info
// Found a match !
// Adjust paths based on the match
@@ -431,7 +433,7 @@
req.setPathInfo(pathI);
Context ctx=container.getContext();
req.setContext(ctx);
- req.setWrapper( container.getHandler() );
+ req.setHandler( container.getHandler() );
req.setContainer( container );
}
1.24 +5 -5 jakarta-tomcat/src/share/org/apache/tomcat/request/StaticInterceptor.java
Index: StaticInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/StaticInterceptor.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- StaticInterceptor.java 2000/10/06 05:19:10 1.23
+++ StaticInterceptor.java 2000/11/02 21:44:51 1.24
@@ -116,7 +116,7 @@
}
public int requestMap(Request req) {
- if( req.getWrapper() != null )
+ if( req.getHandler() != null )
return 0;
Context ctx=req.getContext();
@@ -131,7 +131,7 @@
if( debug > 0 ) log( "RequestMap " + req + " " + absPath + " " + ctx.getAbsolutePath() );
if( absPath == null ) return 0;
- String requestURI=req.getRequestURI();
+ String requestURI=req.requestURI().toString();
if( debug > 0 )
log( "Requested: " + absPath );
@@ -141,7 +141,7 @@
if( file.isFile() ) {
if( debug > 0 ) log( "Setting handler to file " + absPath);
req.setNote( realFileNote, absPath );
- req.setWrapper( ctx.getServletByName( "tomcat.fileHandler"));
+ req.setHandler( ctx.getServletByName( "tomcat.fileHandler"));
return 0;
}
@@ -159,7 +159,7 @@
// Doesn't matter if we are or not in include
if( welcomeFile == null ) {
// normal dir, no welcome.
- req.setWrapper( ctx.getServletByName( "tomcat.dirHandler"));
+ req.setHandler( ctx.getServletByName( "tomcat.dirHandler"));
if( debug > 0) log( "Dir handler");
return 0;
}
@@ -358,7 +358,7 @@
String absPath=FileUtil.safePath( context.getAbsolutePath(),
pathInfo);
File file = new File( absPath );
- String requestURI=subReq.getRequestURI();
+ String requestURI=subReq.requestURI().toString();
String base = ctx.getAbsolutePath();
if (absPath.length() > base.length())
{
1.42 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp12ConnectionHandler.java
Index: Ajp12ConnectionHandler.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp12ConnectionHandler.java,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- Ajp12ConnectionHandler.java 2000/10/08 21:28:58 1.41
+++ Ajp12ConnectionHandler.java 2000/11/02 21:44:56 1.42
@@ -357,7 +357,7 @@
*/
attributes.put(token1, token2);
if(token1.equals("HTTPS") && token2.equals("on")) {
- setScheme("https");
+ this.scheme().setString("https");
}
break;
1.15 +4 -4 jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java
Index: Ajp13ConnectorRequest.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Ajp13ConnectorRequest.java 2000/10/08 21:28:58 1.14
+++ Ajp13ConnectorRequest.java 2000/11/02 21:44:56 1.15
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java,v 1.14 2000/10/08 21:28:58 costin Exp $
- * $Revision: 1.14 $
- * $Date: 2000/10/08 21:28:58 $
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java,v 1.15 2000/11/02 21:44:56 costin Exp $
+ * $Revision: 1.15 $
+ * $Date: 2000/11/02 21:44:56 $
*
* ====================================================================
*
@@ -225,7 +225,7 @@
}
if(isSSL) {
- setScheme("https");
+ this.scheme().setString("https");
}
MessageBytes clB=headers.getValue("content-length");
1.33 +4 -4 jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java
Index: HttpConnectionHandler.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- HttpConnectionHandler.java 2000/09/29 07:01:30 1.32
+++ HttpConnectionHandler.java 2000/11/02 21:44:59 1.33
@@ -1,7 +1,7 @@
/*
- * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v 1.32 2000/09/29 07:01:30 costin Exp $
- * $Revision: 1.32 $
- * $Date: 2000/09/29 07:01:30 $
+ * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpConnectionHandler.java,v 1.33 2000/11/02 21:44:59 costin Exp $
+ * $Revision: 1.33 $
+ * $Date: 2000/11/02 21:44:59 $
*
* ====================================================================
*
@@ -185,7 +185,7 @@
reqA.readNextRequest(resA);
if( secure ) {
- reqA.setScheme( "https" );
+ reqA.scheme().setString( "https" );
}
contextM.service( reqA, resA );
1.6 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpInterceptor.java
Index: HttpInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpInterceptor.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- HttpInterceptor.java 2000/09/29 07:01:31 1.5
+++ HttpInterceptor.java 2000/11/02 21:44:59 1.6
@@ -248,7 +248,7 @@
reqA.readNextRequest(resA);
if( secure ) {
- reqA.setScheme( "https" );
+ reqA.scheme().setString( "https" );
}
contextM.service( reqA, resA );
1.11 +7 -4 jakarta-tomcat/src/share/org/apache/tomcat/session/ServerSessionManager.java
Index: ServerSessionManager.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/session/ServerSessionManager.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ServerSessionManager.java 2000/09/29 07:01:36 1.10
+++ ServerSessionManager.java 2000/11/02 21:45:02 1.11
@@ -61,9 +61,7 @@
package org.apache.tomcat.session;
import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
+import java.util.*;
import org.apache.tomcat.util.*;
import org.apache.tomcat.util.threads.*;
import org.apache.tomcat.helper.*;
@@ -103,6 +101,8 @@
protected Reaper reaper;
+ Random randomSource=null;
+
public ServerSessionManager() {
}
@@ -115,6 +115,7 @@
}
// ------------------------------------------------------------- Properties
+
public int getMaxActiveSessions() {
return maxActiveSessions;
}
@@ -181,7 +182,9 @@
}
// XXX can return MessageBytes !!!
- String newId=SessionUtil.generateSessionId();
+
+
+ String newId= SessionIdGenerator.generateId(randomSource);
// What if the newId belongs to an existing session ?
// This shouldn't happen ( maybe we can try again ? )
1.30 +2 -2 jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java
Index: EmbededTomcat.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- EmbededTomcat.java 2000/10/01 22:21:46 1.29
+++ EmbededTomcat.java 2000/11/02 21:45:05 1.30
@@ -283,8 +283,8 @@
public void start() {
try {
contextM.start();
- } catch( IOException ex ) {
- log("Error starting EmbededTomcat", ex);
+// } catch( IOException ex ) {
+// log("Error starting EmbededTomcat", ex);
} catch( Exception ex ) {
log("Error starting EmbededTomcat", ex);
}
1.13 +3 -2 jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
Index: Main.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Main.java 2000/10/23 15:17:58 1.12
+++ Main.java 2000/11/02 21:45:05 1.13
@@ -378,8 +378,9 @@
public String[] getJarFiles(String ld) {
File dir = new File(ld);
String[] names = dir.list( new FilenameFilter(){
- public boolean accept(File dir, String name) {
- if (name.endsWith(".jar")){
+ public boolean accept(File d, String name) {
+ if (name.endsWith(".jar"))
+ {
return true;
}
return false;
1.21 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/task/ApacheConfig.java
Index: ApacheConfig.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/task/ApacheConfig.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ApacheConfig.java 2000/10/01 06:37:51 1.20
+++ ApacheConfig.java 2000/11/02 21:45:07 1.21
@@ -136,7 +136,7 @@
// Find Ajp12 connector
int portInt=8007;
- BaseInterceptor ci[]=cm.getInterceptors();
+ BaseInterceptor ci[]=cm.getContainer().getInterceptors();
for( int i=0; i<ci.length; i++ ) {
Object con=ci[i];
if( con instanceof Ajp12ConnectionHandler ) {
1.8 +3 -2 jakarta-tomcat/src/share/org/apache/tomcat/task/StartTomcat.java
Index: StartTomcat.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/task/StartTomcat.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- StartTomcat.java 2000/10/11 17:06:52 1.7
+++ StartTomcat.java 2000/11/02 21:45:09 1.8
@@ -120,7 +120,7 @@
try {
cm.start(); // start serving
}
- catch (java.net.BindException be) {
+ catch (TomcatException be) { //java.net.BindException be) {
loghelper.log("Starting Tomcat: " + be.getMessage(), Logger.ERROR);
System.out.println(sm.getString("tomcat.bindexception"));
try {
@@ -137,7 +137,7 @@
xh.setDebug( 0 );
ContextManager cm=new ContextManager();
cm.setParentLoader( parentLoader );
- cm.setServerClassPath( serverClassPath );
+ // cm.setServerClassPath( serverClassPath );
ServerXmlHelper sxml=new ServerXmlHelper();
sxml.setHelper( xh );
@@ -255,6 +255,7 @@
setParentClassLoader( (ClassLoader)v);
} else if( "serverClassPath".equals( n ) ) {
setServerClassPath( (URL[])v);
+ throw new RuntimeException("serverClassPath deprecated");
} else if( "config".equals( n ) ||
"f".equals(n) ) {
setConfig( (String)v);
1.12 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/task/StopTomcat.java
Index: StopTomcat.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/task/StopTomcat.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- StopTomcat.java 2000/10/01 06:37:51 1.11
+++ StopTomcat.java 2000/11/02 21:45:10 1.12
@@ -173,7 +173,7 @@
// Find Ajp12 connector
int portInt=8007;
InetAddress address=null;
- BaseInterceptor ci[]=cm.getInterceptors();
+ BaseInterceptor ci[]=cm.getContainer().getInterceptors();
for( int i=0; i<ci.length; i++ ) {
Object con=ci[i];
if( con instanceof Ajp12ConnectionHandler ) {