cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject New cxf frontend to code generator...
Date Thu, 22 Aug 2013 18:43:35 GMT

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


Mime
View raw message