title: Does the ThreadPoolExecutor Apply the Template Pattern?
body: <p>There are 2 <em>hook methods</em> in the <a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadPoolExecutor.html" rel="nofollow noreferrer">ThreadPoolExecutor</a>. </p>
  
  <p>This <em>technique</em> makes me think of the <em>template method</em> pattern, where there are <em>hook methods</em> in the <code>abstract</code> class. However, the <em>hook methods</em> in the <em>abstract</em> class of <em>template method</em> do differ from that of <code>ThreadPoolExecutor</code> in that:</p>
  
  <ul>
  <li><code>ThreadPoolExecutor</code> class is <em>concrete</em>, whereas the class defining the <em>hook methods</em> in the <em>template method</em> pattern is <code>abstract</code></li>
  <li><em>hook methods</em>, such as <code>beforeExecute(Thread t, Runnable r)</code> and <code>afterExecute(Runnable r, Throwable t)</code>, in <code>ThreadPoolExecutor</code> are <em>concrete</em> with empty <em>method body</em>, whereas <em>hook methods</em> in <code>abstract</code> class of <em>template method</em> pattern are <code>abstract</code> albeit the fact that both <em>hook methods</em> are <code>protected</code> indicating that they should be <code>overridden</code> in their <em>subclasses</em></li>
  </ul>
  
  <p>So my <strong>QUESTIONS</strong> are:</p>
  
  <ul>
  <li><strong>does the <code>ThreadPoolExecutor</code> belong to <em>template method</em> pattern</strong> at all?</li>
  <li><strong>Is the <em>hook method</em> per se. an independent <em>technique</em> from the <em>template method</em> pattern</strong>?    </li>
  </ul>