Pages

Sunday, 3 August 2014

Consuming REST Services using Spring


  1.  RestTemplatemakes interacting with most RESTful services a one-line incantation. And it can even bind that data to custom domain types.
  2. As you can see, this is a simple Java class with a handful of properties and matching getter methods. It’s annotated with @JsonIgnoreProperties from the Jackson JSON processing library to indicate that any properties not bound in this type should be ignored.
  3. Because the Jackson JSON processing library is in the classpath, RestTemplate will use it (via a message converter) to convert the incoming JSON data into a Page object. From there, the contents of the Page object will be printed to the console.
    Here you’ve only used RestTemplate to make an HTTP GET request. But RestTemplatealso supports other HTTP verbs such as POST, PUT, and DELETE.
  4. http://spring.io/guides/gs/consuming-rest/

What does the spring framework do ?


  1. Dependency Injection
  2. AOP (Aspect oriented programming)
  3. Boiler plate coding removal

Monday, 28 July 2014

Too many open files error java mac

-XX:- MaxFDLimit

Directs the VM to refrain from setting the file descriptor limit to the default maximum. The default behavior is to set the limit to the value specified by OPEN_MAX, which is10240. Normally, this is the maximum number of files that a process may have open. It is possible, however, to increase this limit to a user-specified value with the sysctlutility. Under such circumstances, you may want to pass -XX:-MaxFDLimit to stop the Java VM from restricting the number of open files to 10240.