cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Re: Improving JBossWS-CXF Client Side Integration
Date Tue, 02 Jun 2009 17:53:01 GMT

Well, couple things spring to mind:

Option 1: requires no changes to CXF, but requires some classloader magic on 
your side
Write your own that probably subclasses ours and 
overrides the method:
    public ServiceDelegate createServiceDelegate(URL url, QName qname, 
                                             Class cls) {
        Bus bus = BusFactory.getThreadDefaultBus();
        return new ServiceImpl(bus, url, qname, cls);

In your case, return a subclass of our ServiceImpl the does your additional 
stuff.   That way, any cast we may do to ServiceImpl would still work (not 
sure if we do it anywhere, but just in case).  That way, you won't really have 
an extra delegation layer.   Just overrides.     The TRICK is getting your 
provider to be used instead of ours.    Thus, you may need to make sure your 
META-INF/services/  file is picked up before our (or 
use the system property to force yours).    

Option 2: make changes to CXF.   Couple of ideas here.  One could be in our 
createServiceDelegate method above, we do something like:

Provider p = bus.getExtension(Provider.class);
if (p != null) {
    return p.createServiceDelegate(....);
return new ServiceImpl(....);

or similar.   Thus, if a custom Provider is found on the Bus, we'll delegate 
to it.   Heck, we could also put a static "Provider delegate;" field on our 
ProviderImpl that you could set to your provider prior to any calls.   

Or, we could look for a property someplace for the name of the "ServiceImpl" 
class to instantiate.   If set, use reflection to create the ServiceImpl thing 
if set.

Anyway, those are my immediate thoughts.   


On Mon May 25 2009 9:21:35 am Richard Opalka wrote:
> Hi CXF Team,
>    We've spent some time with CXF source code analysis but without success.
> Related issue is:
> We would like to remove one very ugly JBossWS CXF JAX-WS client proxy
> integration hack related to service references (method
> hackServiceDelegate()),
> see:
>    We're registering our custom ServiceDelegate handler (via reflection)
> in original proxy
> and we delegate each call to CXF original service delegate there, with
> one exception.
> We're propagating service ref properties for every port creation before
> returning
> from our custom service delegate (method propagateProps(T proxy,
> Class<T> serviceEndpointInterface)),
> see:
>    Could you guys, with excellent CXF architecture knowledge, give us
> some hints how
> to improve our JBossWS CXF JAX-WS client integration and remove
> aforementioned ugly hack?
> JBossWS Team
> PS: We're looking forward for your suggestions ;)

Daniel Kulp

View raw message