You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2013/08/22 20:43:35 UTC

New cxf frontend to code generator...

I just committed a new "cxf" frontend to the code generator (and updated a couple of the systest poms to use it).  I'd really like a few people to take a quick look.

Basically, it JUST changes the generated Service class (at this point, I'll definitely consider other changes).   The changes are:

1) In the static code, use the CXF LogUtils class instead of the j.u.l.Logger stuff to get the logger.  Thus, the logging would go to wherever CXF is configured to log.

2) Added constructors that pass the Bus as a first argument.

3) To support (2), it subclasses a CXFService class which then subclasses the javax.xml.ws.Service class.  (Doing this requires a slight "hack" using some reflection, I thought about NOT subclassing  javax.xml.ws.Service which would then not need the hack, but then it would be much less "drop in replacement")

4) Don't generate the constructors that don't have the "WebServiceFeature … f" param.   They are redundant as the compiler will pass null for the features any way.

At this point, the generated code is a drop in replacement (from a compile standpoint) to the jaxws  frontend.   There are just additional constructors that are usable.  For the most part, this is to make sure the proper Bus gets used by the client.   This would basically replace the current code you would need to do:

Bus orig = BusFactory.getThreadDefaultBus();
BusFactory.setThreadDefaultBus(myBus);
MyService service = new MyService();
BusFactory.setThreadDefaultBus(orig);

with just:

MyService service = new MyService(myBus);

which should definitely help make sure the correct configuration gets picked up.

Anyway, thoughts are welcome.

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