Qpid
  1. Qpid
  2. QPID-2629

Remove Java client dependency on commons-collection.jar

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7
    • Component/s: Java Client
    • Labels:
      None

      Description

      The JMS client has only a single dependency on the commons-collection.jar.
      It is using the RefereneMap in the message delegates to store the destination cache.

      It would be nice if we could use an alternative instead of having yet another dependency.
      For a client application it's really a big plus point to have as less dependencies as possible

      (Pls note that for the broker module, commons-collection is a transitive dependency, so we can't just remove it from our lib folder).
      But that is fine as it's only a compile time dependency should anybody wish to build the client from source.
      But for runtime we could definitely get rid of it to keep the size small.

      Possible strategies.
      1. Replace the ReferenceMap with a suitable implementation. I don't think WeakHashMap as suggested on a thread is the right solution either.
      We currently use the ref map with hard refs for keys and soft refs for values.

      2. We could just include the necessary files (just 4 actually) in the clients source dir. - This is perfectly legal as per the ASF license this is allowed.
      This also seems like a very good short term solution.

      1. QPID-2629.patch
        39 kB
        Rajith Attapattu

        Activity

        Rajith Attapattu created issue -
        Rajith Attapattu made changes -
        Field Original Value New Value
        Fix Version/s 0.7 [ 12314455 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Hide
        Rajith Attapattu added a comment -

        Attached is patch where I have included the required source files into the client module.
        If there are no disagreements, I intend to check in the patch by friday.

        Show
        Rajith Attapattu added a comment - Attached is patch where I have included the required source files into the client module. If there are no disagreements, I intend to check in the patch by friday.
        Rajith Attapattu made changes -
        Attachment QPID-2629.patch [ 12445603 ]
        Hide
        Emmanuel Bourg added a comment -

        That's fine to copy the classes from Commons Collections, but you may want to change the package to avoid any conflict if Commons Collections is on the classpath.

        Also this issue is for the Java client instead of the C++ client.

        Show
        Emmanuel Bourg added a comment - That's fine to copy the classes from Commons Collections, but you may want to change the package to avoid any conflict if Commons Collections is on the classpath. Also this issue is for the Java client instead of the C++ client.
        Hide
        Rajith Attapattu added a comment -

        Changed the component to "java client" - Thx Emmanuel for spotting it.

        I would assume it's probably ok to rename the package name from "commons" to "qpid".

        Show
        Rajith Attapattu added a comment - Changed the component to "java client" - Thx Emmanuel for spotting it. I would assume it's probably ok to rename the package name from "commons" to "qpid".
        Rajith Attapattu made changes -
        Component/s Java Client [ 12311389 ]
        Component/s C++ Client [ 12311396 ]
        Hide
        Robbie Gemmell added a comment -

        I would copy (with package change as noted above) the files across from a release tag in the Commons section of the repo to maintain commit/version tracking, rather than just applying the patch.

        Not really an issue, but I assume the build.deps addition for slf4j-jdk14-1.4.0.jar actually relates to some other work rather than this JIRA?

        Show
        Robbie Gemmell added a comment - I would copy (with package change as noted above) the files across from a release tag in the Commons section of the repo to maintain commit/version tracking, rather than just applying the patch. Not really an issue, but I assume the build.deps addition for slf4j-jdk14-1.4.0.jar actually relates to some other work rather than this JIRA?
        Hide
        Rajith Attapattu added a comment -

        Patch committed.

        Show
        Rajith Attapattu added a comment - Patch committed.
        Rajith Attapattu made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        40d 15h 20m 1 Rajith Attapattu 06/Jul/10 15:53

          People

          • Assignee:
            Rajith Attapattu
            Reporter:
            Rajith Attapattu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development