Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-1783

Refactor JMS transport second step (patch included)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.2
    • 2.0.9, 2.1.3
    • Transports
    • None

    Description

      I have refactored several parts of the JMS Transport to make it easier to understand and to help preparing for a move to the spring jms classes.
      The refactoring should not change the functionality.

      SessionFactory and PooledSession:
      The sessionfactory had two different caches and a lot of redundant code. I have now only one cache left that starts send only. A consumer is then added when the first client needs it. The lines of code of SessionFactory are reduced from 450 to 300.

      Functionality of JMSProviderHub is splitted between SessionFactory and JMSUtils
      The connect method now does not need a callback anymore. So the interface JMSOnConnectCallback is deleted.

      JMSOutputStream:
      Extracted the class from JMSDestination and JMSConduit. They both use the same JMSOutputStream now. A new interface JMSExchangeSender calls back into JMSConduit or JMSDestination.

      JMSListenerThread and JMSExecutor:
      Extracted JMSListenerThread from JMSDestination. So the complete JMS listen functionality is factored out. This means it will be easier to port to Spring MessageListenerContainer. JMSListener does not use the Session pool anymore as it does not need pooling anyway.

      JMSConduit:
      Made the program flow easier again and documented where the flow of operation is not easy to understand. 420 lines => 290 lines

      JMSDestination:
      Same as with JMSConduit. 550 lines => 420 lines

      Tests:
      All tests work

      • Cut most of PooledSessionTest as it does not apply anymore. Have not written a new test yet. But I think it is mostly implicitly tested by other tests
      • AbstractJMSTests replaced setInMessage with setOutMessage. I think this was wrong before. Please review
      • JMSDestinationTest added a second message send as I had an issue with a closed session after first send because of an error in the SessionFactory. This is to avoid regression

      Attachments

        1. CXF-1783-refactor-jms-2.patch
          111 kB
          Christian Schneider

        Issue Links

          Activity

            People

              njiang Willem Jiang
              cschneider Christian Schneider
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: