Java EE: Concurrency and Multithreading

Java EE: Concurrency and Multithreading

English | MP4 | AVC 1280×720 | AAC 48KHz 2ch | 4h 20m | 762 MB

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).

Topics include:

  • 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
Table of Contents

Introduction
1 Welcome
2 What you should know

Overview and Setup
3 What is concurrency
4 Project setup

Processes and Threads
5 Process vs. thread
6 Java SE multithreading overview
7 Using the Thread class to create and run a thread
8 Using the Runnable interface to create and run a thread
9 Limitations of using basic APIs

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

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

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