Ok, but in this instance these two instantiations are for this method

    @RoutingSlip
    public final String[ ] route( @XPath( "//@webKey" ) final String partner ,
            @XPath( value = "local-name(./node())" , resultType =
String.class ) final String operation )

Are two of them really required, since this is (I presume) a single thread ?

Y.

On 13 August 2010 15:35, Claus Ibsen <claus.ib...@gmail.com> wrote:
> On Fri, Aug 13, 2010 at 2:08 PM, Yiannis Mavroukakis
> <imavrouka...@gameaccount.com> wrote:
>> I have two XPath expressions on a @RoutingSlip bean, I've noticed in the
>> logs that I get this
>>
>> [    New I/O server worker #1-1] XPathBuilder                   DEBUG
>> Creating default XPathFactory
>> [    New I/O server worker #1-1] XPathBuilder                   DEBUG
>> Creating default XPathFactory
>>
>> Does this mean that there are two XPathBuilder instances ?
>>
>
> All the XPath stuff in the JDK is not thread safe and you gotta create
> new instances of the factory.
>
> The XPathFactory class is not thread-safe. In other words, it is the
> application's responsibility to ensure that at most one thread is
> using a XPathFactory object at any given moment. Implementations are
> encouraged to mark methods as synchronized to protect themselves from
> broken clients.
>
>
>>
>> Thanks,
>> Yiannis
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Reply via email to