Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 2448 invoked from network); 25 Feb 2002 22:35:37 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 25 Feb 2002 22:35:37 -0000 Received: (qmail 23027 invoked by uid 97); 25 Feb 2002 22:35:33 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 23011 invoked by uid 97); 25 Feb 2002 22:35:33 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 23000 invoked from network); 25 Feb 2002 22:35:32 -0000 Date: 25 Feb 2002 14:35:16 -0800 Message-ID: <20020225223516.10064.cpmta@c007.snv.cp.net> X-Sent: 25 Feb 2002 22:35:16 GMT Content-Type: multipart/mixed; boundary="----------=_1014676516-9313-0" Mime-Version: 1.0 To: tomcat-dev@jakarta.apache.org From: Christopher K.St.John X-Mailer: Web Mail 3.9.3.5 X-Sent-From: cks@distributopia.com Subject: [PATCH] MinimalTomcat, Coupling, Bugs 6669, 6670 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------------=_1014676516-9313-0 Content-Type: text/plain Content-Disposition: inline I posted to the dev list earlier about needing a small, relatively lightweight version of Catalina to embed into another program. I spent the weekend putting together something that more of less fits my needs. (My needs include a relatively small jar, plus no use of the local file system) I ended up with a 260k jarfile of the catalina classes, plus another 75k or so of new Container classes. I suspect there's at least another 100k that can be trimmed. I ran into a troubling amount of coupling between the various bits of Catalina. The o.a.catalina.* classes were fairly clean, but the implementation classes tended to know a lot about each other. That made reuse difficult, since inheriting from one of the core classes ended up bringing in pretty much every class (and external dependency) in Catalina. The implementation classes obviously need to know something about each other, but there are an awful lot of hardcoded assumptions. The large number of casts makes it very hard to figure out what depends on what. Instead of trying to make the core classes more generic, I ended up writing a new set of Containers and support classes. Using the existing Catalina code made that fairly easy, but much of the code re-use was necessarily of the cut-and-paste variety. There were a couple of especially inconvenient couplings that are probably worth fixing, one trivial and one a little more serious. I've submitted both of these as bugs. First, there's an uneeded import of org.xml.sax.AttributeList in o.a.c.realm.RealmBase. That one's not such a big deal since it doesn't matter at run time. The first of the attached patches removes it. Second, there's a cast to StandardContext in AuthenticatorBase. The cast is needed because AuthenticatorBase wants to use the same debug level as its associated Context, but Container doesn't expose the any set/getDebug methods. It would be good to get rid of the cast because it's the only place that BasicAuthenticator makes assumptions about the exact type of its Context. The second patch just gets rid of the StandardContext import and cast. A better solution might be to move set/getDebug up into Container. Adding a Debug interface would work too, but that seems like overkill. The MinimalTomcat code is definitely alpha quality, and it's only meant to support the particular subset of Catalina that I happen to need right at the moment. It is not, and is not intended to be, a complete reimplementation of the Catalina core classes. On the other hand, it's substantially smaller and less complicated, while retaining the same basic architecture. If anyone's interested, feel free to email me at the address below, or respond on the list. -- Christopher St. John cks@distributopia.com DistribuTopia http://www.distributopia.com ------------=_1014676516-9313-0 Content-Type: application/octet-stream; name="AuthBaseCast.patch" Content-Disposition: attachment; filename="AuthBaseCast.patch" Content-Transfer-Encoding: base64 SW5kZXg6IEF1dGhlbnRpY2F0b3JCYXNlLmphdmEKPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PQpSQ1MgZmlsZTogL2hvbWUvY3ZzcHVibGljL2pha2FydGEtdG9t Y2F0LTQuMC9jYXRhbGluYS9zcmMvc2hhcmUvb3JnL2FwYWNoZS9jYXRhbGlu YS9hdXRoZW50aWNhdG9yL0F1dGhlbnRpY2F0b3JCYXNlLmphdmEsdgpyZXRy aWV2aW5nIHJldmlzaW9uIDEuMjgKZGlmZiAtdSAtcjEuMjggQXV0aGVudGlj YXRvckJhc2UuamF2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UgU2luZ2xlU2lnbk9uIGltcGxlbWVudGF0aW9uIGluIG91ciByZXF1ZXN0 IHByb2Nlc3NpbmcK ------------=_1014676516-9313-0 Content-Type: application/octet-stream; name="RealmBaseImport.patch" Content-Disposition: attachment; filename="RealmBaseImport.patch" Content-Transfer-Encoding: base64 SW5kZXg6IFJlYWxtQmFzZS5qYXZhCj09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0K UkNTIGZpbGU6IC9ob21lL2N2c3B1YmxpYy9qYWthcnRhLXRvbWNhdC00LjAv Y2F0YWxpbmEvc3JjL3NoYXJlL29yZy9hcGFjaGUvY2F0YWxpbmEvcmVhbG0v UmVhbG1CYXNlLmphdmEsdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuOQpkaWZm IC11IC1yMS45IFJlYWxtQmFzZS5qYXZhCi0tLSBSZWFsbUJhc2UuamF2YQk5 IE5vdiAyMDAxIDE5OjQwOjEyIC0wMDAwCTEuOQorKysgUmVhbG1CYXNlLmph dmEJMjUgRmViIDIwMDIgMTk6Mzc6MDIgLTAwMDAKQEAgLTgzLDcgKzgzLDYg QEAKIGltcG9ydCBvcmcuYXBhY2hlLmNhdGFsaW5hLnV0aWwuTGlmZWN5Y2xl U3VwcG9ydDsKIGltcG9ydCBvcmcuYXBhY2hlLmNhdGFsaW5hLnV0aWwuU3Ry aW5nTWFuYWdlcjsKIGltcG9ydCBvcmcuYXBhY2hlLmNhdGFsaW5hLnV0aWwu TUQ1RW5jb2RlcjsKLWltcG9ydCBvcmcueG1sLnNheC5BdHRyaWJ1dGVMaXN0 OwogCiAKIC8qKgo= ------------=_1014676516-9313-0 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: ------------=_1014676516-9313-0--