From the course: Java EE: Concurrency and Multithreading
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Verify code and add the REST method
From the course: Java EE: Concurrency and Multithreading
Verify code and add the REST method
- [Instructor] Now to the Rest class let's add a method and from there we are going to call the Dao class to get all the bank accounts and for every bank account, we'll called the ManagedExecutorService to submit the report generation task. So let's go to the IDE. That's the ReportsResource restful bean that we have created in the constructor we of course did the connection pooling, and that the object that we have gotten through the resource annotation. So let's go ahead and add a material for the rest, which is allowed in the form of get. And I'll say, public, string, generate reports. Okay, and what are we going to do inside? The first thing is, we have to call the Dao to get all the bank accounts. So I'm going to say list, bank accounts, and you have the Dao ready with you, so you just have to call get all back accounts. Once we do this, let's understand a few semantics around what we are going to do. We are going to now use the managed executor service object to submit task of…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Need for Java EE concurrency4m 14s
-
(Locked)
Java EE concurrency APIs3m 52s
-
(Locked)
Set up a Java EE RESTful application8m 4s
-
(Locked)
Running and testing the Java EE RESTful application4m 47s
-
(Locked)
Important Java EE terms4m 4s
-
(Locked)
ManagedExecutorService (MES) overview3m 20s
-
(Locked)
Define the bank account related beans and DAO class3m 28s
-
(Locked)
Add methods in the DAO class10m 30s
-
(Locked)
Define ReportProcessor7m 42s
-
(Locked)
Write REST class for injecting MES objects6m 51s
-
(Locked)
Verify code and add the REST method8m 42s
-
(Locked)
Run and test the ManagedExecutorService application2m 59s
-
(Locked)
ManagedScheduledExecutorService overview2m 22s
-
(Locked)
Defining the URLProcessor for the thread's job6m 47s
-
(Locked)
Add a REST method to call the URLProcessor5m 20s
-
(Locked)
Important pointers and API overview6m 22s
-
(Locked)
ManagedThreadFactory API1m 26s
-
(Locked)
Create a single thread with ManagedThreadFactory6m 7s
-
(Locked)
ManagedThreadFactory with ThreadPoolExecutor7m 2s
-
(Locked)
ContextService API3m 7s
-
(Locked)
Create a contextual proxy9m 15s
-
-
-