title: Monitoring and restarting the Executor Service and Future Task?
body: <p>I am working on a multithreading app in <i>Java 5</i>. When it executes it starts several executor services and it has to run for a very long time. I have a monitor service that keeps a check on the state of each created executor. I have read that the executor service may only have the following states: </p>
  
  <blockquote>
    <ul>
    <li>running, </li>
    <li>shutting down and </li>
    <li>terminated. </li>
    </ul>
  </blockquote>
  
  <p>In case anything strange happens during the execution, 
  I have subclassed my own <i>FutureTask</i> class and overriden the methods: </p>
  
  <ul>
  <li><i>setException</i> and,  </li>
  <li><i>done</i> (anything unusual like ExecutionException and
  InterruptedException are caugth here)</li>
  </ul>
  
  <p>I have a case where an Executor service throws an ExecutionException (in my own FutureTask class). The ExecutionException is caught and logged but my executor service is not logging in anything anymore. My monitor service is outputing the executor service is still alive. 
  Maybe it has to do with the fact that my FutureTask has reached the state done?</p>
  
  <blockquote>
    <ol>
    <li>What is the best way to manage this?</li>
    <li>Is it possible to restart the executor service? </li>
    <li>It looks like the FutureTask state affects the Executor service, can I use the FutureTask's state to know the state of the Executor service.</li>
    </ol>
  </blockquote>
  
  <p>Thanks for your help,</p>