Rest of Project Coin explored, advantage Java 7

Project Coin includes the following proposals that will make into Java 7. – Binary literals and underscores in literals – Strings in switch – Simplified Varargs Method Invocation – Improved Type Inference for Generic Instance Creation (Diamond) – Improved Exception Handling for Java – try-with-resources (ARM) I have briefly touched upon try-with-resources construct in my … Read moreRest of Project Coin explored, advantage Java 7

Handling Flux Database outages using BoneCP Connection Pool

In Flux, we have made improvements in recent versions to handle database or network failures and recover from such failures gracefully without needing to restart Flux. Sometimes, it would be nice to notify administrators about these failures and they can act upon them in case of an unscheduled outage. Flux is dependent on the database … Read moreHandling Flux Database outages using BoneCP Connection Pool

Introducing Try With Resources, can project Coin become crown jewel of Java 7?

Try-with-resources (originally known as Automatic Resource Management) is one of the Project Coin proposals that made its way into recent JDK 7 builds. Traditionally, developers had to manually terminate any resources (Files, Database connections, etc) they use in their applications and sometimes it was painful to keep track of those things and failing to do … Read moreIntroducing Try With Resources, can project Coin become crown jewel of Java 7?

Hate JAXB annotations: MOXy and JAXBIntroductions comes to the rescue

JAXB is the defacto OXM binding framework for the Java platform which performs marshalling (serializing Java to XML) and unmarshalling (deserializing XML to Java) using the standard Java APIs. I must admit that JAXB is a smart addition to the Java Web services technologies stack. It reminds me of days where I used to write … Read moreHate JAXB annotations: MOXy and JAXBIntroductions comes to the rescue

Handling Generified Collections in Jersey JAX-RS

It is quite possible many developers have run into this problem with Jersey, not really a problem, but limitations of a programming language. I remember from school days where C++ Templates had quite a few reference books and it always kept me away from using STL containers 🙂 In Java, we have Generics since 1.5 … Read moreHandling Generified Collections in Jersey JAX-RS

Job Scheduling in Java, why Flux?

I recently came across this interesting question on Job Scheduling in Java in the widely popular experts-exchange website. Unfortunately, you require subscription to see “expert” answers, unlike Stack Overflow. Here is my take on this FAQ: 1) Is it possible to use Sun’s own java.util.TimerTask for my complex report scheduling? Timer facility has limited capabilities … Read moreJob Scheduling in Java, why Flux?

SOAP over RESTy Client

JAX-RS runtime allows applications to supply entity providers which maps services between representations (via @Produces and @Consumes) and their Java types. The entity provider interfaces MessageBodyReader and MessageBodyWriter defines the contract that supports the conversion of a stream to a Java type and vice versa. Lets write a simple JAXRS provider for handling a SOAPMessage … Read moreSOAP over RESTy Client

Accessing RESTful services configured with SSL using RestTemplate

SSL enabled RESTful services are quite easier to develop and test using Jersey, Grizzly and RestTemplate. Jersey (resource development) Grizzly Web Server (resource configuration and deployment) Spring 3 RestTemplate backed by Commons HTTP Client (resource access) In a moment, you will notice how all these nicely fit the bill. Let us start with the POM … Read moreAccessing RESTful services configured with SSL using RestTemplate

RestTemplate, the Spring way of accessing RESTful services

The central API for accessing RESTful services in Spring 3 is RestTemplate. It is like any other template mechanism provided by Spring for the client side access. The default implementation uses the java.net package for creating HTTP requests. RestTemplate can be backed by Commons HttpClient using ClientHttpRequestFactory. Using Commons HttpClient as the backend implementation supports … Read moreRestTemplate, the Spring way of accessing RESTful services

Jersey 1.0.3 improves WADL support

Jersey 1.0.3 was released this week. This release has quite a few interesting new features and improvements to some of its existing functionality. Paul’s blog entry gives the specifics of this release. One of the cool features in this release is the ability to inject WadlApplicationContext in resources. This provides access to the WADL JAXB … Read moreJersey 1.0.3 improves WADL support