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.
Create a single thread with ManagedThreadFactory
From the course: Java EE: Concurrency and Multithreading
Create a single thread with ManagedThreadFactory
- [Narrator] Let's take a look at the Managed Thread Factory demo now. The list of steps is on the slide in front of us. The first step is to add a REST class in the project, so let's head back to the IDE and add a REST class. Let's say this is going to be logging resource. Let's set the path annotation to it on line number 12. Want to say add at path and say log data. Let's also inject the Managed Thread Factory by at resource annotation inside the REST class. So let's go to the concurrent resources tab on the GlassFish admin console. And you can go to manage thread factories and pick up that JNDI name. So I'm copying that. Let's come back to the class and there on line number 18 I'm going to first get the resource annotation. And then get a reference. Sorry, before that I think we need to do the look up. So let's delete this line. We don't need this right now. Let's first do the lookup. And let's give that name. Once we do this there on the next slide we will have a reference to the…
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
-
-
-
-
-
-
Need for Java EE concurrency4m 14s
-
(Locked)
Java EE concurrency APIs3m 52s
-
(Locked)
Set up a Java EE RESTful application8m 4s
-
(Locked)
Running and testing the Java EE RESTful application4m 47s
-
(Locked)
Important Java EE terms4m 4s
-
(Locked)
ManagedExecutorService (MES) overview3m 20s
-
(Locked)
Define the bank account related beans and DAO class3m 28s
-
(Locked)
Add methods in the DAO class10m 30s
-
(Locked)
Define ReportProcessor7m 42s
-
(Locked)
Write REST class for injecting MES objects6m 51s
-
(Locked)
Verify code and add the REST method8m 42s
-
(Locked)
Run and test the ManagedExecutorService application2m 59s
-
(Locked)
ManagedScheduledExecutorService overview2m 22s
-
(Locked)
Defining the URLProcessor for the thread's job6m 47s
-
(Locked)
Add a REST method to call the URLProcessor5m 20s
-
(Locked)
Important pointers and API overview6m 22s
-
(Locked)
ManagedThreadFactory API1m 26s
-
(Locked)
Create a single thread with ManagedThreadFactory6m 7s
-
(Locked)
ManagedThreadFactory with ThreadPoolExecutor7m 2s
-
(Locked)
ContextService API3m 7s
-
(Locked)
Create a contextual proxy9m 15s
-
-
-