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.

Create a single thread with ManagedThreadFactory

Create a single thread with ManagedThreadFactory

From the course: Java EE: Concurrency and Multithreading

Start my 1-month free trial

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…

Contents