Java EE: Concurrency and Multithreading
4h 21mAdvanced2018-09-27
Authors

Ketkee Aryamane
Software Professional
Course details
Unlike the Standard Edition, Java Enterprise Edition (Java EE) supports concurrency. Concurrency is a programming technique—related to parallelism and multithreading—to execute multiple tasks simultaneously, allowing applications to run faster and use resources more efficiently. Understanding Java concurrency is crucial to building modern web applications. In this course, you can learn how to seamlessly integrate concurrency and make your Java applications more efficient and fault tolerant. Instructor Ketkee Aryamane first reviews the multithreading APIs in Java SE—Thread and Runnable—and their limitations, and then explores the four concurrency APIs in Java EE, including demos that show each API in practice. She explains how Java EE makes it possible to communicate between threads, schedule and interrupt threads, and deal with liveness issues. Plus, learn how concurrency works in a distributed environment and how to handle transactions with the Java Transaction API (JTA).
Learning objectives
What is concurrency?
Processes and threads in Java SE
Java EE concurrency APIs
Working with the ManagedExecutorService, ManagedScheduledExecutorService, ManagedThreadFactory, and ContextService APIs
Defining data access object (DAO) classes
Adding methods to DAO classes
Writing REST classes
Creating custom thread factories
Creating contextual proxies
JTA transactions and concurrency
Learning objectives
What is concurrency?
Processes and threads in Java SE
Java EE concurrency APIs
Working with the ManagedExecutorService, ManagedScheduledExecutorService, ManagedThreadFactory, and ContextService APIs
Defining data access object (DAO) classes
Adding methods to DAO classes
Writing REST classes
Creating custom thread factories
Creating contextual proxies
JTA transactions and concurrency
Skills covered
Java EEJavaOracleProgramming LanguagesSoftware DevelopmentDeep Dive (X:Y)
Concepts
0. Introduction
- 01 - Welcome
- 02 - What you should know
1. Overview and Setup
- 03 - What is concurrency
- 04 - Project setup
2. Processes and Threads
- 05 - Process vs. thread
- 06 - Java SE multithreading overview
- 07 - Using the Thread class to create and run a thread
- 08 - Using the Runnable interface to create and run a thread
- 09 - Limitations of using basic APIs
3. Executor API
- 10 - Features of the Executor framework and thread pools
- 11 - Callables and futures
- 12 - Executor and ExecutorService
- 13 - ExecutorService overview
- 14 - Define UserDao and user beans
- 15 - Write the UserProcessor callable implementation
- 16 - Write a test class and run the application
- 17 - Different thread pools
- 18 - ExecutorService - invokeAny and invokeAll
- 19 - ExecutorService shutdown
- 20 - ScheduledExecutorService overview
- 21 - The schedule method
- 22 - scheduleAtFixedRate and scheduleWithFixedDelay
- 23 - ThreadFactory API
- 24 - Create a custom thread factory
4. Java EE Concurrency APIs
- 25 - Need for Java EE concurrency
- 26 - Java EE concurrency APIs
- 27 - Set up a Java EE RESTful application
- 28 - Running and testing the Java EE RESTful application
- 29 - Important Java EE terms
- 30 - ManagedExecutorService (MES) overview
- 31 - Define the bank account related beans and DAO class
- 32 - Add methods in the DAO class
- 33 - Define ReportProcessor
- 34 - Write REST class for injecting MES objects
- 35 - Verify code and add the REST method
- 36 - Run and test the ManagedExecutorService application
- 37 - ManagedScheduledExecutorService overview
- 38 - Defining the URLProcessor for the thread's job
- 39 - Add a REST method to call the URLProcessor
- 40 - Important pointers and API overview
- 41 - ManagedThreadFactory API
- 42 - Create a single thread with ManagedThreadFactory
- 43 - ManagedThreadFactory with ThreadPoolExecutor
- 44 - ContextService API
- 45 - Create a contextual proxy
5. Concurrency and Transactions
- 46 - Java Transaction API (JTA) transactions with concurrency
- 47 - Define the data sources in GlassFish server
- 48 - Define the session bean class for database operations
- 49 - Define the transaction processor
- 50 - Define the REST class
- 51 - Run the JTA application
Conclusion
- 52 - Next steps
Related courses
Related learn paths
- Become a Java EE 7 Developer
- Become a Java Programmer
- Building Your Java Skills
- Getting Started as a Java Developer
- Java Foundations Professional Certificate by JetBrains
- Advance Your Java Skills
- Prepare for the Java SE 8 Programmer (1Z0-808) Certification
- Prepare for the MongoDB Java Developer Associate Certification