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.

Defining the URLProcessor for the thread's job

Defining the URLProcessor for the thread's job

From the course: Java EE: Concurrency and Multithreading

Defining the URLProcessor for the thread's job

- [Narrator] Let's go ahead with the Managed Scheduled Executor Service demo. So the steps are listed on the slide. Of course, it's the use case for the health check of the app. So the first step is add a REST class in the project and assign path annnotation to it. So let's go to IDE, and in this, I'm going to create a class under the com.app.rest and I'm going to label this URL "HealthResource" let's say. And let's add the path annotation to it. And let's give it a value. So let's say we're going to call this "urlCheck." What's the next step? Inject the Managed Scheduled Executor Service object by the resource annotation and the REST will be. So we have our server, and we have the Concurrent Resources. Let's go to Concurrent Resources and Managed Scheduled Executor Service. So the default object that the container anyway provides you, the GlassFish server. It's available to you right there. So I'm gonna take that JNDI name, copy it, and come back to the IDE. And inside this, I'm…

Contents