Interrupted Exception

From a google search for InterruptedException

 Class InterruptedException

public class java.lang.InterruptedException extends java.lang.Exception (I-�1.30) { // Constructors public InterruptedException(); �1.37.1 public InterruptedException(String s); �1.37.2 }

Thrown when a thread is waiting, sleeping, or otherwise paused for a long time and another thread interrupts it using the interrupt method in class Thread.


    public InterruptedException()
      Constructs an InterruptedException with no detail message.
    public InterruptedException(String  s)
      Constructs an InterruptedException with the specified detail message.
        s -the detail message

I would like InterruptedException to be an UncheckedException. Id est, I only want to handle it in very specific situations and I don't like to contaminate all my code with "throws InterruptedException". But on certain situations is usefull to catch this exception (AurelianoCalvo, RefactorAtWill).
And related to InterruptedException, there's InterruptedIOException which is actually a subclass of IOException, but will be thrown when a blocking IO-operation is interrupted.

See Also: MaskInterrupts

CategoryException | CategoryJava

View edit of October 19, 2008 or FindPage with title or text search