Mapping Collections using Orika

1. Introduction In our Java objects, we generally use some kind of collection, be it a List or Map. When mapping collection-typed fields, we genera...

Continue Reading

Quick Guide to Orika

1. Introduction Orika is a Java Bean mapping library. Essentially it recursively copies data from one object to another using the provided mapping ...

Continue Reading

Guide to Thread Interruption in Java

1. Overview Thread interruption is a mechanism to signal a thread that it must stop its execution at a convenient point. However, it is up to the r...

Continue Reading

Task Cancellation in Java

1. Overview In Java, there is no safe way to preemptively stop a task running on a Thread in that the task must cooperate and be responsive to the ...

Continue Reading

Submit Tasks in Batch using ExecutorService

1. Overview In this tutorial, we're going to look at how we can submit tasks in batch using the ExecutorService implementations. 2. Sample Applicat...

Continue Reading

Shut Down Thread Pool using Java ExecutorService

1. Overview In this tutorial, we'll look at how we can shut down a thread pool using Java ExecutorService. We'll evaluate two different approaches:...

Continue Reading

Create Thread Pool using Java ExecutorService

1. Overview In this tutorial, we're going to examine how we can create a thread pool using ExecutorService. We'll start with the Executors class si...

Continue Reading

CyclicBarrier in Java

1. Introduction In this tutorial, we're going to look at how we can use CyclicBarrier in Java. Primarily, a CyclicBarrier allows threads to wait fo...

Continue Reading

Scoped Beans As Dependencies in Spring

1. Overview In Spring applications, most of the beans are singletons. And we generally achieve the collaboration by declaring beans as dependencies...

Continue Reading

Create Beans Conditionally using Spring

1. Introduction In this tutorial, we'll look at how we can create beans conditionally using Spring. For this purpose, we'll use the @Conditional an...

Continue Reading