title: Managed Executor Service replacing Executor Service to use Container threads( jboss app server) instead of JVM
body: <p>I am using below Executor service which is using newFixedTreadPool of size 2.
  I want instead of JVM, App server jboss to manage thread so plan on replacing ExecutorService to ManagedExecutorService. Question was is my understanding right here and if so can I pass newFixedThreadPool to managedExecutorService or just leave it to be managed by container. What is best and recommended Production-ready solution</p>
  <pre><code>Callable callableObj = () -&gt; { 
    Map&lt;String, String&gt; dsTokenMap = //some function call; return dsTokenMap; }; 
  ExecutorService service = Executors.newFixedThreadPool( 2 ); 
  Future future = service.submit( callableObj );
  
  try { 
    Map result = future.get(500,TimeUnit.MILLISECONDS); 
    logDebug( &quot;result from Async call is :::&quot;+result ); } 
  catch ( Exception ex ) {
  }
  
  </code></pre>