You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Lukasz Matuszczak <l....@atrem.pl> on 2005/07/22 14:50:48 UTC

SAXDocumentFactory thread-safe?

Is it possible to build many documents at the same time (many threads) using the 
same instance of SAXDocumentFactory?

I've tried to build my ExtendedDocumentLoader which could share documents across 
many JSVGCanvas-es, but I get strange exceptions such as:
java.lang.NullPointerException

at 
org.apache.batik.dom.util.SAXDocumentFactory.startElement(SAXDocumentFactory.java:556)

Should I create many instances of SAXDocumentFactory in my DocumentLoader 
extension? Is this class lightweight or is it expensive to create many instances 
of it?

Thanks in advance.
Lukasz 



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: SAXDocumentFactory thread-safe?

Posted by Lukasz Matuszczak <l....@atrem.pl>.
----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: <ba...@xmlgraphics.apache.org>
Sent: Friday, July 22, 2005 2:54 PM
Subject: Re: SAXDocumentFactory thread-safe?


> Lukasz Matuszczak wrote:
>> Is it possible to build many documents at the same time (many threads) 
>> using the same instance of SAXDocumentFactory?
> 
>    Absolutely not.

Thanks, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: SAXDocumentFactory thread-safe?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Lukasz Matuszczak wrote:
> Is it possible to build many documents at the same time (many threads) 
> using the same instance of SAXDocumentFactory?

    Absolutely not.

> Should I create many instances of SAXDocumentFactory in my 
> DocumentLoader extension? Is this class lightweight or is it expensive 
> to create many instances of it?

    It is fairly light weight, mostly it just holds a small amount of
state to properly build a DOM from the SAX events.

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org