Hi Etienne,
Basically you want to check if a class will be serialised by ULC or not.
One solution I can think of is search the coder for the class of the value
object.
If the coder is found it will be serialized else and error will be thrown.
String providerClassname =
DevelopmentRunner.getServerRegistryProviderClassName();
CoderRegistry registry =
ServerCoderRegistryProviderFactory.createCoderRegistryProvider(providerCla
ssname).getCoderRegistry();
IStreamCoder coder = registry.getCoder(value.getClass().getName());
if (coder == null) {
System.err.println("Illegal class type: " + value.getClass());
....
}
You can do the same for the client side registry.
let me know if this works for you.
In the meantime I will try to find if there is another solution.
Thanks and regards,
Janak
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Etienne Studer
Sent: Friday, November 03, 2006 2:20 AM
To: [email protected]
Subject: [ULC-developer] Anything.fromObject(value);
Hi
How can I update the code below to run with ULC 6.1.1?
This code is used for debugging purposes (in development runner), detecting
values to be sent to the client which are of a type not supported for
serialization. Basically, I want to get an exception if the value is of a
type that cannot be handled by any installed coder.
try {
Anything.fromObject(value);
} catch (RuntimeException rte) {
System.err.println("Illegal class type: " + value.getClass());
}
Thanks, Etienne
_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer