title: How do I call some blocking method with a timeout in Java?
body: <p>Is there a standard nice way to call a blocking method with a timeout in Java?  I want to be able to do:</p>
  
  <pre><code>// call something.blockingMethod();
  // if it hasn't come back within 2 seconds, forget it
  </code></pre>
  
  <p>if that makes sense.</p>
  
  <p>Thanks.</p>