You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Raj Floyd <ra...@gmail.com> on 2013/10/18 08:32:48 UTC

CXF Extensions

Is there any way, I can get the list of CXF extension beans, loaded by Bus,
programatically. The 'extensions' field is protected in the CXFBusImpl.

Thanks

Raj

Re: CXF Extensions

Posted by Raj Floyd <ra...@gmail.com>.
Thanks Andrei, it helped.


On Sat, Oct 19, 2013 at 8:13 PM, Andrei Shakirin <as...@talend.com>wrote:

> Hi,
>
> Some extensions are obtained dynamically using ConfiguredBeanLocator and
> just cached into extensions field.
> Therefore it could be not enough just to look into extensions field of the
> CXFBusImpl class.
> I guess this is also main reason why there is no getAllExtensions() method
> in the Bus interface.
>
> To see which extensions are already cached in extensions field, you can
> use reflection API:
> field = CXFBusImpl.class.getDeclaredField("extensions");
> field.setAccessible(true);
> Map<Class<?>,Object> extensions = (Map<Class<?>,Object>)
> field.get(cxfBusInstance);
>
> Regards,
> Andrei.
>
> > -----Original Message-----
> > From: Raj Floyd [mailto:rajfloyd@gmail.com]
> > Sent: Freitag, 18. Oktober 2013 08:33
> > To: users@cxf.apache.org
> > Subject: CXF Extensions
> >
> > Is there any way, I can get the list of CXF extension beans, loaded by
> Bus,
> > programatically. The 'extensions' field is protected in the CXFBusImpl.
> >
> > Thanks
> >
> > Raj
>

RE: CXF Extensions

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

Some extensions are obtained dynamically using ConfiguredBeanLocator and just cached into extensions field.
Therefore it could be not enough just to look into extensions field of the CXFBusImpl class.
I guess this is also main reason why there is no getAllExtensions() method in the Bus interface.

To see which extensions are already cached in extensions field, you can use reflection API:
field = CXFBusImpl.class.getDeclaredField("extensions");
field.setAccessible(true);
Map<Class<?>,Object> extensions = (Map<Class<?>,Object>) field.get(cxfBusInstance);

Regards,
Andrei.

> -----Original Message-----
> From: Raj Floyd [mailto:rajfloyd@gmail.com]
> Sent: Freitag, 18. Oktober 2013 08:33
> To: users@cxf.apache.org
> Subject: CXF Extensions
> 
> Is there any way, I can get the list of CXF extension beans, loaded by Bus,
> programatically. The 'extensions' field is protected in the CXFBusImpl.
> 
> Thanks
> 
> Raj