You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2011/08/15 13:31:37 UTC

Proxies as abstract classes?

Has anyone ever considered the utility or practicality of generating a
concrete subclass of an abstract class as a proxy? All the standards
we conform to are relentless about interfaces, aren't they?

Re: Proxies as abstract classes?

Posted by Sergey Beryozkin <sb...@gmail.com>.
It is possible to generate proxies from concrete classes in cxf jaxrs,
provided cglib is available on classpath.
I haven't tried abstract classes, but I guess it should work.
Cheers, Sergey

On Mon, Aug 15, 2011 at 12:31 PM, Benson Margulies
<bi...@gmail.com> wrote:
> Has anyone ever considered the utility or practicality of generating a
> concrete subclass of an abstract class as a proxy? All the standards
> we conform to are relentless about interfaces, aren't they?
>



-- 
Sergey Beryozkin

http://sberyozkin.blogspot.com
Talend - http://www.talend.com

Re: Proxies as abstract classes?

Posted by Sergey Beryozkin <sb...@gmail.com>.
HI

On Mon, Aug 15, 2011 at 9:45 PM, Daniel Kulp <dk...@apache.org> wrote:
> On Monday, August 15, 2011 7:31:37 AM Benson Margulies wrote:
>> Has anyone ever considered the utility or practicality of generating a
>> concrete subclass of an abstract class as a proxy? All the standards
>> we conform to are relentless about interfaces, aren't they?
>
> Using ASM or cglib to do this really shouldn't be too hard if it's something
> you really wanted to tackle.  :-)    The ClientProxyFactory stuff would need
> to be updated to call cls.isInterface() and do something a bit smarter if it's
> not.   Not really sure what the demand for something like that would be
> though.
>
ProxyHelper in common utils can help in case of cglib being used.
This feature can be of interest for creating JAX-RS proxies because
JAX-RS root resources
are often not implementing any interfaces at all, this is why I'm
finding it useful when writing tests :-)

Cheers, Sergey

> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> Talend - http://www.talend.com
>



-- 
Sergey Beryozkin

http://sberyozkin.blogspot.com
Talend - http://www.talend.com

Re: Proxies as abstract classes?

Posted by Daniel Kulp <dk...@apache.org>.
On Monday, August 15, 2011 7:31:37 AM Benson Margulies wrote:
> Has anyone ever considered the utility or practicality of generating a
> concrete subclass of an abstract class as a proxy? All the standards
> we conform to are relentless about interfaces, aren't they?

Using ASM or cglib to do this really shouldn't be too hard if it's something 
you really wanted to tackle.  :-)    The ClientProxyFactory stuff would need 
to be updated to call cls.isInterface() and do something a bit smarter if it's 
not.   Not really sure what the demand for something like that would be 
though.  

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com