Re: Sloppy, Lazy Tomcat Developers (Was: Persistent "xmlValidation" Problem)
Costin Manolache wrote: Well, my point was - do we really need this feature ? If nobody is really using it - it doesn't work out of box and we didn't see any major complaint except Bob - it may be simpler to just remove the flag from the docs and server.xml - and maybe even remove the code that does this validation. Or move it to some module that is not distributed by default, in case we have 2-3 users. I believe we no longer include the xerces parser in some of the distros - so even a fix in xerces will be useless, users will need to upgrade the VM. It is silly to depend on a very specific parser and version - and keep options, code, documentation - for a feature that nobody really uses. I'd prefer leaving it, and the user, if he's interested in the feature, will have to find a Xerces build that works (I tested, and the one we ship in the compat package works fine for all webapps; the one from my JDK 1.5 has issues though, with the 2.3 webapps). Don't worry though, we'll deviate from a pure Servlet/JSP server quickly enough ;) Rémy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r331062 - in /tomcat/sandbox/java/org/apache/coyote: ./ adapters/ standalone/
Author: costin Date: Sat Nov 5 19:13:06 2005 New Revision: 331062 URL: http://svn.apache.org/viewcvs?rev=331062&view=rev Log: Code for testing ( and using ) coyote standalone. The adapters are very simple, more as example. The goal is to have a minimal http connector, and play with nio and other apis in a simpler environment About MessageWriter and MessageReader - they are copies of Catalina/connector/OutputBuffer and InputBuffer. Renamed to avoid confusion. Long term, they should be part of o.a.coyote package, there is no dep on catalina and are usefull in in connector. Added: tomcat/sandbox/java/org/apache/coyote/ tomcat/sandbox/java/org/apache/coyote/adapters/ tomcat/sandbox/java/org/apache/coyote/adapters/Counters.java tomcat/sandbox/java/org/apache/coyote/adapters/FileAdapter.java tomcat/sandbox/java/org/apache/coyote/adapters/HelloWorldAdapter.java tomcat/sandbox/java/org/apache/coyote/adapters/JsAdapter.java tomcat/sandbox/java/org/apache/coyote/adapters/Mapper.java tomcat/sandbox/java/org/apache/coyote/standalone/ tomcat/sandbox/java/org/apache/coyote/standalone/ClientAbortException.java tomcat/sandbox/java/org/apache/coyote/standalone/Main.java tomcat/sandbox/java/org/apache/coyote/standalone/MessageReader.java tomcat/sandbox/java/org/apache/coyote/standalone/MessageWriter.java Added: tomcat/sandbox/java/org/apache/coyote/adapters/Counters.java URL: http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/coyote/adapters/Counters.java?rev=331062&view=auto == --- tomcat/sandbox/java/org/apache/coyote/adapters/Counters.java (added) +++ tomcat/sandbox/java/org/apache/coyote/adapters/Counters.java Sat Nov 5 19:13:06 2005 @@ -0,0 +1,78 @@ +package org.apache.coyote.adapters; + +import java.util.List; +import java.util.ArrayList; + +import org.apache.coyote.Adapter; +import org.apache.coyote.Request; +import org.apache.coyote.Response; + +/** + * Used to collect statistics to evaluate performance of the coyote layer. + * + */ +public class Counters implements Adapter { + +// per thread +public static class CountData { +public long time; +public long requests; +public int exceptions; +} + +// quick hack - need to move the per-thread code from tomcat +List counters=new ArrayList(); +ThreadLocal tl=new ThreadLocal(); + +Adapter next; + +public Counters() { +} + +public void setNext( Adapter adapter ) { +next=adapter; +} + +public Adapter getNext( ) { +return next; +} + +public void service(Request req, final Response res) throws Exception { +long t0=System.currentTimeMillis(); +CountData cnt=(CountData)tl.get(); +if( cnt == null ) { +cnt=new CountData(); +counters.add( cnt ); +tl.set( cnt ); +// TODO: deal with thread death +} + +cnt.requests++; +try { +next.service(req,res); +} catch( Exception ex ) { +cnt.exceptions++; +throw ex; +} finally { +long t1=System.currentTimeMillis(); +cnt.time+=( t1-t0); +} + +} + +/** Returns statistics for the server. + * TODO: make it per thread, agregate all threads + * + * @return + */ +public CountData getCounts() { +CountData total=new CountData(); +for( int i=0; i< counters.size(); i++ ) { +CountData cd=((CountData)counters.get(i)); +total.requests+= cd.requests; +total.time+=cd.time; +total.exceptions+=cd.exceptions; +} +return total; +} +} \ No newline at end of file Added: tomcat/sandbox/java/org/apache/coyote/adapters/FileAdapter.java URL: http://svn.apache.org/viewcvs/tomcat/sandbox/java/org/apache/coyote/adapters/FileAdapter.java?rev=331062&view=auto == --- tomcat/sandbox/java/org/apache/coyote/adapters/FileAdapter.java (added) +++ tomcat/sandbox/java/org/apache/coyote/adapters/FileAdapter.java Sat Nov 5 19:13:06 2005 @@ -0,0 +1,127 @@ +package org.apache.coyote.adapters; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Properties; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.coyote.Adapter; +import org.apache.coyote.Request; +import org.apache.coyote.Response; +import org.apache.coyote.standalone.MessageWriter; +import org.apache.tomcat.util.buf.ByteChunk; +import org.apache.tomcat.util.buf.C2BConverter; + +/** + * Serve a static file. This is the traditional method, a separate adapter could + * use Sendfile. + * + * No fancy things. Not sure if it should have dir support even. +
Re: svn commit: r331062 - in /tomcat/sandbox/java/org/apache/coyote: ./ adapters/ standalone/
- Original Message - From: <[EMAIL PROTECTED]> To: Sent: Saturday, November 05, 2005 7:13 PM Subject: svn commit: r331062 - in /tomcat/sandbox/java/org/apache/coyote: ./ adapters/ standalone/ Author: costin Date: Sat Nov 5 19:13:06 2005 New Revision: 331062 URL: http://svn.apache.org/viewcvs?rev=331062&view=rev Log: Code for testing ( and using ) coyote standalone. +import org.mozilla.javascript.Context; +import org.mozilla.javascript.EvaluatorException; +import org.mozilla.javascript.Function; +import org.mozilla.javascript.JavaScriptException; +import org.mozilla.javascript.Scriptable; +import org.mozilla.javascript.ScriptableObject; +import org.mozilla.javascript.WrappedException; I take it that MPL is compatible with ASF? For those that don't want to search the archives, my vote is +1 on this issue. I just wanted to make certain that everyone is aware of this, since it is buried in a long commit message. This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments. In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: svn commit: r331062 - in /tomcat/sandbox/java/org/apache/coyote: ./ adapters/ standalone/
I think cocoon is also using rhino, and few other projects - ant is using it via BSF. In any case - it is just an example, not required in any way - it's easier to do some tests and experiments in a scripting language. The build.xml file will just detect if js.jar is available and skip this file otherwise ( nothing depends on the JsAdapter ). Costin On 11/5/05, Bill Barker <[EMAIL PROTECTED]> wrote: > > - Original Message - > From: <[EMAIL PROTECTED]> > To: > Sent: Saturday, November 05, 2005 7:13 PM > Subject: svn commit: r331062 - in /tomcat/sandbox/java/org/apache/coyote: ./ > adapters/ standalone/ > > > > Author: costin > > Date: Sat Nov 5 19:13:06 2005 > > New Revision: 331062 > > > > URL: http://svn.apache.org/viewcvs?rev=331062&view=rev > > Log: > > Code for testing ( and using ) coyote standalone. > > > +import org.mozilla.javascript.Context; > > +import org.mozilla.javascript.EvaluatorException; > > +import org.mozilla.javascript.Function; > > +import org.mozilla.javascript.JavaScriptException; > > +import org.mozilla.javascript.Scriptable; > > +import org.mozilla.javascript.ScriptableObject; > > +import org.mozilla.javascript.WrappedException; > > I take it that MPL is compatible with ASF? For those that don't want to > search the archives, my vote is +1 on this issue. I just wanted to make > certain that everyone is aware of this, since it is buried in a long commit > message. > > > > This message is intended only for the use of the person(s) listed above as > the intended recipient(s), and may contain information that is PRIVILEGED and > CONFIDENTIAL. If you are not an intended recipient, you may not read, copy, > or distribute this message or any attachment. If you received this > communication in error, please notify us immediately by e-mail and then > delete all copies of this message and any attachments. > > In addition you should be aware that ordinary (unencrypted) e-mail sent > through the Internet is not secure. Do not send confidential or sensitive > information, such as social security numbers, account numbers, personal > identification numbers and passwords, to us via ordinary (unencrypted) e-mail. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]