News from Sep 01, 2008

  2008/09/01
Refactorings for Apache CXF JMS Transport
Last changed: Aug 31, 2008 22:29 by Christian Schneider

Over the weekend I did some bigger refactorings for the Apache CXF JMS transport to prepare it for the new configuration model. When I started the JMS code was really difficult to read. The code used callbacks at several places and jumped around between Classes and their subclasses.

I have done a first refactoring in issue CXF-1773. The biggest improvement was getting rid of the class JMSTransportBase. This class was a mixture of methods that did not use the class attributes and mostly accessors for attributes. After the refactoring most code is in static methods in JMSUtils which can all be understood independently.

Today I have worked on the next stage of the refactoring. The first thing I did was getting rid of the callback that happens after making the JMS connect in JMSProviderHub. I managed to refactor the code so that the connect method now simply returns the sessionFactory. I also completely restructured the JMSConduit. Both refactorings really help to understand the code as the flow is now much straighter.

Now we are ready to start thinking about how the code can use the Spring JMSTemplate and ListenerContainer. I guess when this is done a lot of lines of code in JMS Transport will not be necessary anymore. But this change will be difficult and I will have to dicuss several things with the CXF core developers before starting.

Posted at 01 Sep @ 12:00 AM by Christian Schneider | 3 Comments