From the course: Java EE: Concurrency and Multithreading

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Define the REST class

Define the REST class

From the course: Java EE: Concurrency and Multithreading

Start my 1-month free trial

Define the REST class

- [Narrator] The next step will be to write a REST class for that transaction demo, and then we will get hold of the ManagedExecutorService object, which we will have to inject through the @Resource annotation. Let's go to the IDE. Let's go under the REST folder, and create a class, which we will call Transaction Resource, okay. Let's come down and let's define the part and addition for it. Okay, and this is a transaction that you're doing so let's this time use the @POST method of the javax. So we'll use the POST annotation, and a simple method public string execute transactions. Okay, and what are we going to do here? We're going to first inject the managed executor service object. Right, for that let's go to concurrent resources managed executor service and pick up the name, the default resource, come back to IDE, and under the transaction resource class online number 18, I will inject that resources. I say lookup. Okay. And of course take a reference for it. So private managed…

Contents