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.

ContextService API

ContextService API

- [Instructor] Let's now take a look at the last of the APIs and the Enterprise Edition concurrency utilities, the ContextService API. Before that let's quickly revise a couple of terms we have used them before, here and there, but let's take a look again. The first one is, what is a contextual object? So it is any Java object or instance which will have the particular application component's container context associated with it. And when you talk about a contextual task it is a task which is submitted to the managed resource. So when a task instance is submitted to a managed instance of the ExecutorService then the task becomes a contextual task. And when the contextual task runs the task behaves as if it were still running inside the container it was submitted with. When you have an application component like Enterprise JavaBean or a servlet then we know that the thread that is running is going to have the contextual information associated with it. Now when you talk about the…

Contents