Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-4188

JMSSender not extendable

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.4, 1.4.1, 1.5
    • None
    • JMS transport
    • None
    • All

    Description

      We need to extend the org.apache.axis2.transport.jms.JMSSender class so that we can add some custom properties to the JMS Message (most likely via the MessageContext. However, the class is full of private methods which must be copied into a sub-class, and it also uses other classes such as JMSOutTransportInfo that only have package protected constructors.

      This class is clearly meant to be extended because you can redefine the implementation class in the axis2.xml. But rather then just extending it and overridding a method, you have to jump through hoops and copy a bunch of code to do so.

      In my opinion this is one of the most frustrating things about using open source code. Many Apache (and Sun projects as well) have a bad habit of coding everything private, package protected, or sometimes even making things final! Most open source projects these days are designed to be extended, but coding things in this way defeats that purpose.

      Sorry for the long rant and rave, overall I think Axis2 is really great, but could you keep this in mind moving forward , and at least maybe make these methods protected in the next release:

      JMSSender -

      private Message createJMSMessage(MessageContext msgContext, Session session) throws JMSException {
      }

      private void setProperty(Message message, MessageContext msgCtx, String key){
      }

      private String getProperty(MessageContext mc, String key) {
      }

      private static void handleException(String s) {
      }

      private static void handleException(String s, Exception e) {
      }

      Attachments

        Activity

          People

            asankha Asankha Chamath Perera
            breif Ben Reif
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2m
                2m
                Remaining:
                Remaining Estimate - 2m
                2m
                Logged:
                Time Spent - Not Specified
                Not Specified