From the course: Java EE: Concurrency and Multithreading
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Define the REST class
From the course: Java EE: Concurrency and Multithreading
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…
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
-
-
-
-
-
-
-
Java Transaction API (JTA) transactions with concurrency4m 38s
-
(Locked)
Define the data sources in GlassFish server5m 4s
-
(Locked)
Define the session bean class for database operations6m 47s
-
(Locked)
Define the transaction processor5m 3s
-
(Locked)
Define the REST class3m 20s
-
(Locked)
Run the JTA application2m 44s
-
-