From the course: Java EE 8 Essential Training
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Asynchronous features - Java EE Tutorial
From the course: Java EE 8 Essential Training
Asynchronous features
- [Instructor] JAX-RS 2.0 introduced the capability to make a resource method asynchronous, which allows developers to better utilize expensive resources like threads on a server. A typical resource method will hold a thread until a response is returned to the client. Using async, we can free up threads to perform processing while we wait for long running operations. Let's see this in action by adding an async resource method to our inventory items resource. To do that, we're going to create a copy of the find by catalog ID method on the class and once we do that, we'll need to change the name of the method. I'm just going to call it async find by catalog ID, and then async methods do not return anything, so we're going to change the type to void and then we'll go ahead and remove the body of the method. The next thing I'm going to do is remove the JAX-RS mapping annotations from the previous method. In order to indicate…
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
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Rest overview1m 58s
-
(Locked)
JAX-RS overview5m
-
(Locked)
JAX-RS project setup3m 11s
-
(Locked)
Creating a resource5m 16s
-
(Locked)
JAX-RS client posts7m 22s
-
(Locked)
JAX-RS client gets4m 23s
-
(Locked)
URI template parameters2m 49s
-
(Locked)
Asynchronous features7m 51s
-
(Locked)
Reactive features5m 31s
-
(Locked)
Server-Sent Events6m 16s
-
(Locked)
-
-
-
-
-
-