aspose file tools
The moose likes Threads and Synchronization and the fly likes How should one deal with InterruptedException ?. Any best practices ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "How should one deal with InterruptedException ?. Any best practices ?" Watch "How should one deal with InterruptedException ?. Any best practices ?" New topic
Author

How should one deal with InterruptedException ?. Any best practices ?

Steven Rodeo
Ranch Hand

Joined: Mar 06, 2008
Posts: 72
I've been looking at few articles on line on how to deal with InterrruptedException, do you folks suggest any best practices ?.

-SR
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

As suggested in Java concurrency in practice,

Never eat the Interrupted exception.

Either propagate it to your caller(re-throw or don't catch) or set the Interrupted status back in the thread using

The above is on the assumption that someone in the calling stack knows how to deal with it. That someone typically will be your thread pool.


apigee, a better way to API!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How should one deal with InterruptedException ?. Any best practices ?
 
Similar Threads
How about AJAX in Action?
Purpose of Wild Card in Reference
How to handle Security in a Webapp with a JDBCRealm
Spring Best Practices
Is There any Emphasis on Continuous Inspection