You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by rssole <rs...@hotmail.com> on 2011/09/21 14:58:37 UTC

overriding initialize methods of AbstractFeature

Hi, I've created custom feature which I couldn't run within application
I have configuration like this
<jaxws:endpoint
            id="someService"
            implementor="#someServiceBean"
            address="/getSomething">
        <jaxws:features>
            <ref bean="someCustomFeature" />
        </jaxws:features>
    </jaxws:endpoint>

So, it didn't work as I have overriden method:
void initialize(InterceptorProvider interceptorProvider, Bus bus) as per
example here: http://cxf.apache.org/docs/features.html
but that didn't work until I've overriden this:
void initialize(Server server, Bus bus)

Can someone please shed some light on this, I've came up with conclusion
that 
depending on whether service is exposed through <server> or <endpoint> or
consumed through <client> tag, different initialization methods are
invoked... 

I've proven my findings by simply overriding all methods printin some output
to console and  with my config this one
void initialize(InterceptorProvider interceptorProvider, Bus bus)
is not invoked. 

The question is simply... what is relation between particular config and
initialize method which will be invoked?

I am asking here as there are not much examples on this and book Apache CXF
Web Service Development has not dedicated much space to features.

Thanks and regards.

--
View this message in context: http://cxf.547215.n5.nabble.com/overriding-initialize-methods-of-AbstractFeature-tp4826226p4826226.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: overriding initialize methods of AbstractFeature

Posted by rssole <rs...@hotmail.com>.
Thanks! :) 

I am silly old blind man! That is exactly what is overriden in example on
CXF site...

God knows how and why I have seen just "initialize"... :)

Once again,
thank you very much!

--
View this message in context: http://cxf.547215.n5.nabble.com/overriding-initialize-methods-of-AbstractFeature-tp4826226p4829260.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: overriding initialize methods of AbstractFeature

Posted by Daniel Kulp <dk...@apache.org>.

You  need to override the method:

    protected void initializeProvider(InterceptorProvider provider, Bus bus) {
        // you could customized the interceptors in the provider here
    }

if you want it to apply to pretty much everything that a feature can 
initialize.

The method you are overriding is only called in very particular circumstances 
where neither a client or a server is yet created which doesn't occur to 
often.  

Dan



On Wednesday, September 21, 2011 5:58:37 AM rssole wrote:
> Hi, I've created custom feature which I couldn't run within application
> I have configuration like this
> <jaxws:endpoint
>             id="someService"
>             implementor="#someServiceBean"
>             address="/getSomething">
>         <jaxws:features>
>             <ref bean="someCustomFeature" />
>         </jaxws:features>
>     </jaxws:endpoint>
> 
> So, it didn't work as I have overriden method:
> void initialize(InterceptorProvider interceptorProvider, Bus bus) as per
> example here: http://cxf.apache.org/docs/features.html
> but that didn't work until I've overriden this:
> void initialize(Server server, Bus bus)
> 
> Can someone please shed some light on this, I've came up with conclusion
> that
> depending on whether service is exposed through <server> or <endpoint> or
> consumed through <client> tag, different initialization methods are
> invoked...
> 
> I've proven my findings by simply overriding all methods printin some output
> to console and  with my config this one
> void initialize(InterceptorProvider interceptorProvider, Bus bus)
> is not invoked.
> 
> The question is simply... what is relation between particular config and
> initialize method which will be invoked?
> 
> I am asking here as there are not much examples on this and book Apache CXF
> Web Service Development has not dedicated much space to features.
> 
> Thanks and regards.
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/overriding-initialize-methods-of-AbstractFe
> ature-tp4826226p4826226.html Sent from the cxf-user mailing list archive at
> Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com