Hi Janak,
great!
Thanks,
Robert
----- Original Message -----
From: "Janak Mulani" <[EMAIL PROTECTED]>
To: "ulc rbeeger" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, June 09, 2006 11:39 AM
Subject: RE: [ULC-developer] CoderRegistry is too restrictive
Hi Robert,
I have created a feature request:
https://www.canoo.com/jira/browse/UBA-6938
For now, CoderRegistry being final, you will have to make do with a
wrapper
class like the one you have created.
Thanks and regards,
Janak
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of ulc rbeeger
Sent: Wednesday, June 07, 2006 2:39 PM
To: [EMAIL PROTECTED]
Subject: [ULC-developer] CoderRegistry is too restrictive
Hi!
We have developed an extension that starts ULC's ErrorDialog to show a
message and the stacktrace of a Throwable.
For ULC 6.0.x we serialized the Throwable into an Anything on the server
(actually only the message and stacktrace) and wrapped that inside a
subclass of Throwable that could return the message and print the
stacktrace
from the contents of that Anything on the client.
Now with 6.1 we have a coder on the server that writes the message and
stacktrace into two Strings and a coder on the client that creates the
client-side wrapper from those strings.
The problem is that registering the server side coder like so
registry.registerCoder(NullPointerException.class, new
ThrowableCoder());
doesn't help since the registry returns only coders for matching classes.
So
if a coder for NullPointerException is searched none is found, since
coders
for superclasses are not taken into account.
Registering the coder for any possible Exception class is not possible
since
we really don't know each kind of Exception that may arise.
We are now forced to create an ExceptionWrapper and register the coder for
that wrapper. We'll need to wrap the Exceptions into that wrapper to make
sure a coder can be found.
I understand the reason for not taking superclasses into account when
searching for coders. It makes the whole system safer. Coders won't be
chosen by accident. Nevertheless I think it should be possible to register
coders explicitely for a class and any subclasses that don't have coders
registered for them. It could be another differently named method like
registerCoderForClassAndSupclasses(Class, Coder).
Unfortunately CoderRegistry is final and even if it were not, there
doesn't
seem to be any way to replace it with a custom implementation.
Cheers,
Robert
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer