Keith Visco wrote:

"Stein M. Hugubakken" wrote:



Is this thread-safe?


That really depends on the implementation of the ClassDescriptorResolver
I suppose. It's been a while since I last looked into thread-safety
issues with Castor, so I can't say for sure if our default implementation
is thread safe or not. However if someone is aware of a problem, please
report it via bugzilla!

I can't really guess as to what thread-related issues would arise,
perhaps the possibility of loading a class / class descriptor twice? If
two threads detect that a class descriptor hasn't been loaded they both
load the class descriptor, one will overwrite the other one, but I don't
really see that as an issue.

Of course we'd have to analyze that code a bit more to determine possible
problem areas. Are you aware of any?


ClassDescriptorResolverImpl uses an error-variable in case of exceptions and users of ClassDescriptorResolverImpl test if an error occured.


Marshaller throws an exception if ClassDescriptorResolverImpl.error() returns true, but UnmarshalHandler just prints the error-message.

This is the only real problem as I can see because ClassDescriptorResolverImpl uses Hashtable for caching and putting an item already in the table doesn't do any harm since this will actually be the same instance anyway.

We need to change the ClassDescriptorResolver-interface, but since this in fact defines error() and getErrorMessage() I think we are changing it to better anyway.

Comments?

I can do the changes, just give me thumbs up or down...

Stein

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev




Reply via email to