Description
In this coures, you will :
- Learn how to integrate concurrency into your Java applications to make them more efficient and fault tolerant.
- reviews the multithreading APIs in Java SE—Thread and Runnable—as well as their limitations, and then delves into the four concurrency APIs in Java EE, including demos that demonstrate each API in action.
- explains how Java EE allows threads to communicate, schedule and interrupt threads, and deal with liveness issues
- Learn how concurrency works in a distributed environment and how to use the Java Transaction API to handle transactions (JTA).
Syllabus :
1. Overview and Setup
- What is concurrency?
- Project setup
2. Processes and Threads
- Process vs. thread
- Java SE multithreading overview
- Using the Thread class to create and run a thread
- Using the Runnable interface to create and run a thread
- Limitations of using basic APIs
3. Executor API
- Features of the Executor framework and thread pools
- Callables and futures
- Executor and ExecutorService
- ExecutorService overview
- Define UserDao and user beans
- Write the UserProcessor callable implementation
- Write a test class and run the application
- Different thread pools
- ExecutorService: invokeAny and invokeAll
- ExecutorService shutdown
- ScheduledExecutorService overview
- The schedule method
- scheduleAtFixedRate and scheduleWithFixedDelay
- ThreadFactory API
- Create a custom thread factory
4. Java EE Concurrency APIs
- Need for Java EE concurrency
- Java EE concurrency APIs
- Set up a Java EE RESTful application
- Running and testing the Java EE RESTful application
- Important Java EE terms
- ManagedExecutorService (MES) overview
- Define the bank account related beans and DAO class
- Add methods in the DAO class
- Define ReportProcessor
- Write REST class for injecting MES objects
- Verify code and add the REST method
- Run and test the ManagedExecutorService application
- ManagedScheduledExecutorService overview
- Defining the URLProcessor for the thread's job
- Add a REST method to call the URLProcessor
- Important pointers and API overview
- ManagedThreadFactory API
- Create a single thread with ManagedThreadFactory
- ManagedThreadFactory with ThreadPoolExecutor
- ContextService API
- Create a contextual proxy
5. Concurrency and Transactions
- Java Transaction API (JTA) transactions with concurrency
- Define the data sources in GlassFish server
- Define the session bean class for database operations
- Define the transaction processor
- Define the REST class
- Run the JTA application