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.
Callables and futures
From the course: Java EE: Concurrency and Multithreading
Callables and futures
- [Narrator] So let's take a quick look at the Executor framework hierarchy. The first thing is all the Executor interfaces will reside in the java.util.concurrent package. That's the package for them. And there are three main components. Starting at the top, you have the Executor interface, which is a basic interface. And then, down there, you have a subinterface, which is the ExecutorService. Now this is the most crucial interfaces that we generally use in applications. And, to a further extension, we have ScheduledExecutorService, which is, again, a subinterface of ExecutorService. So, ScheduledExecutorService is exactly the one which will allow you to schedule jobs at regular intervals and all of that stuff. Okay. So we're going to look at the demos for each one of them. But before that, let's all to understand what are Callables and what are Futures. Now, when we take the demo for thread and the Runnable APIs, we actually define the job of the thread inside the run method, right?…
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
-
-
-
-
-
Features of the Executor framework and thread pools4m 35s
-
(Locked)
Callables and futures2m 16s
-
(Locked)
Executor and ExecutorService3m 58s
-
(Locked)
ExecutorService overview3m 3s
-
(Locked)
Define UserDao and user beans6m 50s
-
(Locked)
Write the UserProcessor callable implementation5m 31s
-
(Locked)
Write a test class and run the application10m 48s
-
(Locked)
Different thread pools5m 20s
-
(Locked)
ExecutorService: invokeAny and invokeAll7m 18s
-
(Locked)
ExecutorService shutdown5m 18s
-
(Locked)
ScheduledExecutorService overview2m 7s
-
(Locked)
The schedule method5m 16s
-
(Locked)
scheduleAtFixedRate and scheduleWithFixedDelay6m 42s
-
(Locked)
ThreadFactory API2m 34s
-
(Locked)
Create a custom thread factory5m 26s
-
-
-
-