costin 01/08/16 21:02:55 Modified: src/share/org/apache/tomcat/core BaseInterceptor.java Container.java Handler.java OutputBuffer.java Request.java Response.java ServerSession.java Log: Same thing. Some fields were package, changed them to private. Now the core is consistent ( I hope ), at least from methods declaration point of view. Revision Changes Path 1.51 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/core/BaseInterceptor.java Index: BaseInterceptor.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/BaseInterceptor.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- BaseInterceptor.java 2001/08/03 02:40:20 1.50 +++ BaseInterceptor.java 2001/08/17 04:02:54 1.51 @@ -567,7 +567,7 @@ debug=d; } - public final void setContextManager( ContextManager cm ) { + public void setContextManager( ContextManager cm ) { this.cm=cm; this.ct=cm.getContainer(); } 1.53 +15 -15 jakarta-tomcat/src/share/org/apache/tomcat/core/Container.java Index: Container.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Container.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- Container.java 2001/08/03 02:41:29 1.52 +++ Container.java 2001/08/17 04:02:54 1.53 @@ -101,7 +101,7 @@ private ContextManager contextM; // The webapp including this container, if any - Context context; + private Context context; // The type of the mapping public static final int UNKNOWN_MAP=0; @@ -109,14 +109,14 @@ public static final int PREFIX_MAP=2; public static final int EXTENSION_MAP=3; public static final int DEFAULT_MAP=4; - int mapType=0; + private int mapType=0; // Common map parameters ( path prefix, ext, etc) - String transport; - String path; - String proto; - String vhosts[]; + private String transport; + private String path; + private String proto; + private String vhosts[]; // Container attributes - it's better to use // notes, as the access time is much smaller @@ -124,16 +124,16 @@ /** The handler associated with this container. */ - Handler handler; - String handlerName; + private Handler handler; + private String handlerName; /** Security constraints associated with this Container */ - String roles[]=null; + private String roles[]=null; - String methods[]=null; + private String methods[]=null; - boolean special=false; + private boolean special=false; public Container() { initHooks(); @@ -417,9 +417,9 @@ public static final int H_engineInit=16; public static final int H_COUNT=17; - Hooks hooks=new Hooks(); - BaseInterceptor hooksCache[][]=null; - BaseInterceptor allHooksCache[]=null; + private Hooks hooks=new Hooks(); + private BaseInterceptor hooksCache[][]=null; + private BaseInterceptor allHooksCache[]=null; private void initHooks() { hooks.registerHook( "postReadRequest", H_postReadRequest ); @@ -536,7 +536,7 @@ } // debug - public static final int dL=0; + private static final int dL=0; private void debug( String s ) { System.out.println("Container: " + s ); } 1.41 +7 -7 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.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- Handler.java 2001/08/03 02:47:32 1.40 +++ Handler.java 2001/08/17 04:02:54 1.41 @@ -126,8 +126,8 @@ // Debug protected int debug=0; protected Log logger=null; - Handler next; - Handler prev; + protected Handler next; + protected Handler prev; private Object notes[]=new Object[ContextManager.MAX_NOTES]; @@ -174,11 +174,11 @@ this.state=i; } - public final String getName() { + public String getName() { return name; } - public final void setName(String handlerName) { + public void setName(String handlerName) { this.name=handlerName; } @@ -330,18 +330,18 @@ /** Debug level for this handler. */ - public final void setDebug( int d ) { + public void setDebug( int d ) { debug=d; } - protected final void log( String s ) { + protected void log( String s ) { if ( logger==null ) contextM.log(s); else logger.log(s); } - protected final void log( String s, Throwable t ) { + protected void log( String s, Throwable t ) { if(logger==null ) contextM.log(s, t); else 1.20 +8 -8 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.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- OutputBuffer.java 2001/07/17 03:14:46 1.19 +++ OutputBuffer.java 2001/08/17 04:02:54 1.20 @@ -77,7 +77,7 @@ * * @author Costin Manolache */ -public final class OutputBuffer extends Writer +public class OutputBuffer extends Writer implements ByteChunk.ByteOutputChannel, CharChunk.CharOutputChannel // sink for conversion bytes[] { @@ -107,8 +107,8 @@ private ByteChunk bb; private CharChunk cb; - String enc; - boolean gotEnc=false; + private String enc; + private boolean gotEnc=false; private Response resp; private Request req; @@ -128,7 +128,7 @@ cb.setLimit( size ); } - public OutputBuffer(Response resp) { + private OutputBuffer(Response resp) { this( DEFAULT_BUFFER_SIZE ); setResponse( resp ); } @@ -158,7 +158,7 @@ bb.setOffset(c); } - void log( String s ) { + protected void log( String s ) { System.out.println("OutputBuffer: " + s ); } @@ -321,8 +321,8 @@ doFlush = false; } - Hashtable encoders=new Hashtable(); - C2BConverter conv; + protected Hashtable encoders=new Hashtable(); + protected C2BConverter conv; public void setEncoding(String s) { enc=s; @@ -337,7 +337,7 @@ conv.flushBuffer(); // ??? } - private void setConverter() { + protected void setConverter() { if( resp!=null ) enc = resp.getCharacterEncoding(); if( debug > 0 ) log("Got encoding: " + enc ); 1.109 +1 -1 jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java Index: Request.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v retrieving revision 1.108 retrieving revision 1.109 diff -u -r1.108 -r1.109 --- Request.java 2001/08/12 01:49:56 1.108 +++ Request.java 2001/08/17 04:02:54 1.109 @@ -238,7 +238,7 @@ return state; } - final void setState( int state ) { + public final void setState( int state ) { this.state=state; } 1.54 +3 -2 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.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- Response.java 2001/08/06 15:45:25 1.53 +++ Response.java 2001/08/17 04:02:54 1.54 @@ -130,8 +130,9 @@ /** Init is called from CM when the object is added to tomcat. */ - void init() { - oBuffer=new OutputBuffer( this ); + protected void init() { + oBuffer=request.getContextManager().createOutputBuffer(); + oBuffer.setResponse( this ); } public Object getFacade() { 1.12 +5 -1 jakarta-tomcat/src/share/org/apache/tomcat/core/ServerSession.java Index: ServerSession.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ServerSession.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- ServerSession.java 2001/08/12 01:49:56 1.11 +++ ServerSession.java 2001/08/17 04:02:55 1.12 @@ -144,7 +144,7 @@ facade=o; } - public int getState() { + public final int getState() { return state; } @@ -159,6 +159,10 @@ this, state); } } + this.state=state; + } + + protected void setState1( int state ) { this.state=state; }