All Downloads are FREE. Search and download functionalities are using the official Maven repository.

brooklyn.util.exceptions.RuntimeInterruptedException Maven / Gradle / Ivy

Go to download

Utility classes and methods developed for Brooklyn but not dependendent on Brooklyn or much else

There is a newer version: 0.7.0-M1
Show newest version
package brooklyn.util.exceptions;

/**
 * A {@link RuntimeException} that is thrown when a Thread is interrupted.
 * 

* This exception is useful if a Thread needs to be interrupted, but the {@link InterruptedException} can't be thrown * because it is checked. *

* When the {@link RuntimeInterruptedException} is created, it will automatically set the interrupt status on the calling * thread. * * @author Peter Veentjer. */ public class RuntimeInterruptedException extends RuntimeException { private static final long serialVersionUID = 915050245927866175L; public RuntimeInterruptedException(InterruptedException cause) { super(cause); Thread.currentThread().interrupt(); } public RuntimeInterruptedException(String msg, InterruptedException cause) { super(msg, cause); Thread.currentThread().interrupt(); } @Override public InterruptedException getCause() { return (InterruptedException) super.getCause(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy