| 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!
|
 |
 |
|
|
subject: How should one deal with InterruptedException ?. Any best practices ?
|
|
|