Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 87626 invoked by uid 500); 31 Oct 2001 11:13:14 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 87615 invoked from network); 31 Oct 2001 11:13:13 -0000 From: "Carsten Ziegeler" To: Subject: RE: ThreadSafe Parser Date: Wed, 31 Oct 2001 12:14:51 +0100 Message-ID: MIME-Version: 1.0 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-reply-to: <3BDFC041.5F6194FE@anyware-tech.com> X-MIMETrack: Itemize by SMTP Server on PBSN1/Systeme und Netzwerke(Release 5.0.8 |June 18, 2001) at 31.10.2001 12:13:39, Serialize by Router on PBSN1/Systeme und Netzwerke(Release 5.0.8 |June 18, 2001) at 31.10.2001 12:13:40, Serialize complete at 31.10.2001 12:13:40 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Sylvain, unfortunately the underlying JAXP classes (SAXParserFactory etc.) are not guaranteed to be thread safe. As the parser uses them in the parse method, it cannot be thread safe either. But changing the parser interface in a way you suggest, will be considered when it's moved to Avalon (except the thread-safe point). Carsten > > Hi team, > > After seeing the recent changes to Parser, I wondered why this component > cannot be ThreadSafe. The answer is simple : Parser extends XMLProducer > and thus setConsumer() must be called before parse(). > > Searching for Parser use in the sources, I found that it doesn't seem to > be used as an XMLProducer, but always as a Parser, and that the two > calls setConsumer() and parse() always come together. > > So, what about a stateless interface for parsing, which would simply > mean moving the XMLConsumer parameter from setConsumer() to parse() ? > > interface StatelessParser extends DOMFactory { > void parse(InputSource source, XMLConsumer consumer); > void parse(InputSource source, ContentHandler ch); > Document parseDocument(InputSource is); > } > > Since XML parsing is widely used, this would be a step further for > speeding up Cocoon. > > Thoughts ? > -- > Sylvain Wallez > Anyware Technologies - http://www.anyware-tech.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org > For additional commands, email: cocoon-dev-help@xml.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org