heroku/heroku.jar — pull request #62 by ryanbrainard (2012-07-26 23:59:41+00:00)
Title: Add jersey-client HTTP & JSON Modules

This introduces two new modules that allows Jersey Client to be used as the HTTP Connection and/or JSON Parser:

- heroku-http-jersey-client (based on com.sun.jersey:jersey-client)
- heroku-json-jersey-client (based on com.sun.jersey:jersey-json, which is based on Jackson)

This is helpful for projects that rely on both jersey-client and heroku.jar so they don't have to bring in more dependencies than needed.

I noticed some of the other HTTP modules 1) override the SSL behavior and 2) have an intermediary class between AsyncConnection and their implementations. It wasn't really clear the point of either of these, so I left this out of Jersey Client, but of course can be added if it is needed some reason.

The synchronous `execute()` simply calls the `asyncExecute()`, which in turn uses Jersey Client's built in async capabilities. Jersey Client also has a separate sync capability, which I considered using directly, but it would cause a lot of duplication without necessarily any gain. I'm open to thoughts on this.

Jersey Client also allows for different HTTP and JSON implementations and other dynamic configurations. For now, these are not exposed in Heroku.jar, but could be good additions. Also, Heroku.jar currently uses properties for version coordination, but using dependencyManagement would be better so transitive dependencies (e.g. jersey-client versions) can match up and easily be overridden by consumers. For now, I followed the pattern of the other modules, but I think we should change this everywhere in Heroku JAR in the future.