river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Kleczek <michal.klec...@xpro.biz>
Subject River-436 - need some explanation of preferred class provider
Date Sun, 02 Mar 2014 19:07:23 GMT
while woking on the River-436 patch proposal I've came across the 
scenario that I am not sure how to handle:

Utility service:
//inteface is NOT preferred
interface Util {...}
//class IS preferred
class UtilProxy implements Util {}

Wrapper service:
//NOT preferred
interface Wrapper {}
class WrapperProxy implements Serializable{
   //initialized with Util impl from a lookup service
   private Util util;

Wrapper service codebase includes Util interface but it is _preferred_.

Would deserialization of WrapperProxy end with ClassCastException?
 From what I understand UtilProxy is annotated with its codebase. When 
deserializing UtilProxy a ClassLoader is going to be created with parent 
set to TCCL. It means Util interface is going to be loaded twice by two 
ClassLoaders - one for WrapperProxy codebase and another for UtilProxy 

Am I correct?
And if so: is it desired behavior?


Michał Kłeczek
XPro Quality Matters

View raw message