Creating RESTful Webservice and Client API in JAX-RS 2.0

java-jee

In my previous post I wrote about using JAXB to marshall and unmarshal XML data and in that I used the example of simple Book management system. In this post I am expanding on that to create a RESTful Webservice using the refrence implementation of JAX-RS i.e Jersey and also using the new Client API […]

Getting Started with JAXB

xml

There are quite a few APIs out there for processing XML in Java like DOM Parser, SAX Parser, SAX parser to name a few. But there are scenarios and requirements where we have our data in Java beans and we want that data to be transformed into XML or we have some data in XML […]

Bean Validation in Java EE 7 – Creating Custom Constraints and Validations

javaee7-thumbnail

In my previous post I showed how one can make use of the default constraints provided by the Bean Validation API in validatng the model data. Bean Validation API allows the developers to define their own constraints by creating a new annotation and writing the validator which is used to validate the value. In this […]

Bean Validation 1.1 in Java EE 7 – Using Default Constraints

java-jee

Bean Validation 1.1 (JSR 349) is integrated as part of Java EE 7. The new features of Bean Validation 1.1 are as follows: Applying constraints on method parameters and return values. This can be used in creating a pre and post condition contract. Constraints can be applied to constructors. New API to obtain metadata of […]

Creating Managed Threads Using ManagedThreadFactory in Java EE 7 – Part 3

java-jee

So far we have seen: In Part-1: Creating ManagedExecutorService to submit a single task or a list of tasks where each task would be an implementation of either Callable or Runnable interface. In Part-2: Creating ManagedScheduledExecutorService for scheduling tasks to run at a later time or to schedule repeating tasks. In this post, which will […]

ManagedScheduledExecutorService for Implementing Concurrency Utilities in Java EE 7 – Part 2

java-jee

In my previous post you saw how to use the concurrency utilities in Java EE 7 by using the ManagedExecutorService. In this post we will have a look at a variant of this i.e the ManagedScheduledExecutorService. ManagedScheduledExecutorService is used to schedule tasks to be executed in future by specifying the delay in terms of SECONDS, […]

ManagedExecutorService for Implementing Concurrency Utilities in Java EE 7 – Part 1

java-jee

Prior to Java EE 7 one could make use of the concurrency utilities present in java.util.concurrent package or the java.lang.Thread or java.lang.Runnable. But it was not considered a best practice, not a standard and not safe for the application. This was because the Java EE web and EJB containers instantiate objects using container-managed thread pools […]

Using Encoder With WebSocket in Java EE 7

java-jee

In my previous post I wrote about using decoders with WebSocket. In the same post I mentioned about Encoders and that they are used for encoding the Java objects or any data into some string/binary format which is then sent to the client end point of the websocket connection. In this post I will elaborate […]

Using Decoder With WebSocket In Java EE 7

java-jee

This post is part of the series of posts covering different JavaEE 7 features. In the past I wrote about: Creating WebSocket using JavaEE 7 Parsing JSON using the JSR 353 implementation in JavaEE 7- Using the Streaming API. Parsing JSON using the JSR 353 implementation in JavaEE 7- Using the Object Model API. This […]

JSON Processing in JavaEE 7- Using Object Model API

java-jee

In my previous post about JSON processing I introduced you to the sample application and then showed how one can make use of the Streaming API to parse the JSON data. The JSON Streaming API was not suited for scenarios explained in my previous post. In such scenarios one can make use of the Object […]