Book Image

Java EE 7 Development with WildFly

Book Image

Java EE 7 Development with WildFly

Overview of this book

Table of Contents (21 chapters)
Java EE 7 Development with WildFly
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 12. Long-term Tasks' Execution

So far, our applications focused on interaction with the user. This may be the most important aspect of your future projects, but there are some scenarios that require a different approach. Maintenance tasks, importing big sets of data or time-consuming computations are usually addressed in a batch mode instead of an interactive manner. Often, these kinds of jobs are not part of the standard operations and should be invoked only when the server load is at its lowest or periodical.

Before Java EE 7, there was no standardized way to implement batch jobs (operations that do not require user interaction). The deal changed with JSR 352 (https://jcp.org/en/jsr/detail?id=352) and the introduction of the batch framework, which uses an XML language to define jobs.

When it comes to processor-intensive tasks, the natural way is to think about parallelization. Modern CPUs have multiple cores, which can be easily utilized by the JVM. The only problem is that in Java...