The deserializer factory creates the deserializer. You could have the deserializer factory set the date format object on the deserializer, before it gets returned o Axis to use for deserializing. In this way, the deserializer factory could maintain a list of SimpleDateFormat objects, marking each in use, as it is set in a deserializer. You'd have to figure out how to mark the object as no longer in use, perhaps by code in the onEndElement() method in the deserializer.
I guess you could re-use complete deserializers in this way.
Tony
"Martin Heitz" <[EMAIL PROTECTED]> wrote on 14/12/2004 12:30:13:
> Hi,
>
> thanks for your answers.
> The reason for asking this is, that I have (de)serializers for a
> composed type which does not have a default constructor. So I need
> (as far as I understand the concept) at least a deserializer for
> rebuilding the object. One of the attributes of the object has the
> type dateTime, so I have a SimpleDateFormat to parse this. Sorrowly
> the SimpleDateFormat is quite expensive to create, so I do not want
> to create one for each parse process, but have a SimpleDateFormat
> class member in the deserializer to reuse it.
> Now the second "but": But the SimpleDateFormat is not thread-safe,
> it rarely occurrs that a runtime exception is thrown or that dates
> are not formatted correctly.
> If the deserializer is not used by multiple threads simultaneously I
> do not have an issue here, but if it is shred I run into trouble.'
>
> If - as Brian J. Sayatovic writes - Axis gets a new instance each
> time from the factories my idea of improving performance by having a
> SimpleDateFormat as class mebmber does not help anyway :-(
>
> Best regards from sunny Black Forrest, Germany,
> Mattin
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 14, 2004 12:26 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Serializer- and Deserializer-objects multi-threaded?
>
> I've never seen any reference to threads in descriptions of
> serializers and deserializers (Axis 1.1). Certainly, the
> BeanSerializer has no special code for handling multiple threads,
> that I can see. It looks as though a new serializer/deserializer is
> created, from the factory, each time a type needs to be processed in
> the message. In any case, I can't quite see why you'd want to store
> state between calls to the serializer or deserializer, or store
> state in the de/serializer whilst processing a call.
>
> Tony
>
> "Martin Heitz" <[EMAIL PROTECTED]> wrote on
> 14/12/2004 10:55:38:
>
> > Hi,
> >
> > short question: Are Axis Serializer- and Deserializer-objects shared by
> > multiple threads (do they need to be thread-safe)?
> >
> > My question relates to Axis 1.1, but (because upgrading to a newer
> > release is always something one may not get out of sight) I am also
> > interested in an answer for Axis 1.2.
> >
> > Best regards from Black Forrest, Germany,
> >
> > Martin Heitz
> > Distributed Network Accounting Team
> >
> > Elsag Solutions AG
> > Roggenbachstr. 1
> > D-78050 Villingen-Schwenningen
> > Germany
> > http://www.elsag-solutions.com
> > Tel: +49-(0)7721-9175-595
> > Fax: +49-(0)7721-9175-800
> >
> >
- Serializer- and Deserializer-objects multi-threaded? Martin Heitz
- Re: Serializer- and Deserializer-objects multi-thr... tony . q . weddle
- Re: Serializer- and Deserializer-objects multi-thr... Brian J. Sayatovic
- RE: Serializer- and Deserializer-objects multi-thr... Martin Heitz
- Re: Serializer- and Deserializer-objects multi... tony . q . weddle
- Re: Serializer- and Deserializer-objects multi... Brian J. Sayatovic
- RE: Serializer- and Deserializer-objects multi-thr... Martin Heitz
- RE: Serializer- and Deserializer-objects multi... tony . q . weddle
- RE: Serializer- and Deserializer-objects multi-thr... Martin Heitz
- Unable to deploy typemapping error Kibaya E.
- RE: Serializer- and Deserializer-objects multi-thr... Martin Heitz