Reputation: 15
We are developing a Java EE Web Application which is deployed on Websphere Web server. Currently, there is a requirement for concurrent execution to speed-up the response time. So among the below choices, which and why will be a better selection?
ExecutorService
Managed Executor Service
(What are the basic usage & implementation difference between these above two methods)Upvotes: 0
Views: 842
Reputation: 17872
The javadoc for ManagedExecutorService makes the difference pretty clear:
A ManagedExecutorService extends the Java™ SE ExecutorService to provide methods for submitting tasks for execution in a Java™ EE environment. Implementations of the ManagedExecutorService are provided by a Java™ EE Product Provider. Application Component Providers use the Java Naming and Directory Interface™ (JNDI) to look-up instances of one or more ManagedExecutorService objects using resource environment references. ManagedExecutorService instances can also be injected into application components through the use of the Resource annotation.
You should simply use the spec-defined EE concurrency utilities (including ManagedExecutor).
Upvotes: 1