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

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…

Contents