• Categories
  • Search

Limiting threads used for asynchronous requests - Jersey Client

Jersey Client already has support for making asynchronous requests, but it uses default ExecutorService, which spawns new thread for each request, which is not very convenient in most of cases. You can set your own ExecutorService (see Client.setExecutorService()) and limit thread count but it is not that obvious thing and lots of users are not aware of this possibility. So I've added another property to ClientConfig class which represents threadpool size of...

Friday, May 20, 2011 | Read More

Jersey Client - Apache HTTP Client 4.x integration

Since this week, Jersey users can benefit from Apache HTTP Client 4.x integration. "jersey-apache-http-client4" module has been finalized and provides similar functionality as "jersey-apache-http-client", but make sure you read javadoc - most of settings have changes because of major change in Apache HTTP Client API. How to start with Jersey and Apache HTTP Client 4.x? Add following dependency: <dependency>     <groupId>com.sun.jersey.contribs</groupId>   ...

Wednesday, April 20, 2011 | Read More

Jersey - Grizzly 2.x integration

Since today, Jersey users can benefit from Grizzly 2.x integration. "jersey-grizzly2" module has been finalized and provides same functionality as "jersey-grizzly" and new test framework module was added - "jersey-test-framework-grizzly2", which also became default test container for nearly all our test and samples. How to start with Jersey and Grizzly 2.x? If you want to be able to run your application from command line by executing mvn compile exec:java, see Main.java from...

Wednesday, March 16, 2011 | Read More

Code coverage using Cobertura

We were requested to investigate and implement code coverage measurement and report generation to our project - Jersey. Nice opportunity to get into new thing and have a motivation to finish (since this was a "must do" type of request..). Alright, let's get into it. At the begging, we had to decide which tool we are going to use - Cobertura [1] won, one of main arguments are nicer reports, active development and price (it's free). There is a nice set of scripts, which can...

Wednesday, February 23, 2011 | Read More

Replacing client used in Jersey Test Framework

There was an interesting question on mailing list - Is it possible to replace default Jersey client in JerseyTest? (JerseyTest is a class from Jersey Test Framework, basically superclass of all "Jersey enabled" tests). Answer is.. not really. It just wasn't made to support this option. Until now :) There was method getClient(), but it couldn't be easily overriden (it was private static) and it actually does more that create Client, so it isn't really method you want to replace....

Friday, February 11, 2011 | Read More

Visit the Oracle Blog


Contact Us


Integrated Cloud Applications & Platform Services