- java.lang.Object
-
- de.carne.util.Threads
-
public final class Threads extends java.lang.ObjectUtility class providing Thread related functions.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckInterrupted()Checks whether the current Thread has been interrupted.static java.lang.ClassLoadergetContextClassLoader()Gets the context ClassLoader of the current Thread or the system ClassLoader if none is set.static booleansleep(long millis)Causes the current Thread to sleep.
-
-
-
Method Detail
-
checkInterrupted
public static void checkInterrupted() throws java.lang.InterruptedExceptionChecks whether the current Thread has been interrupted.- Throws:
java.lang.InterruptedException- if the current Thread has been interrupted.
-
sleep
public static boolean sleep(long millis)
Causes the current Thread to sleep.In addition to Thread.sleep(long) this function automatically handles possible InterruptedExceptions by handling and discarding the exception.
- Parameters:
millis- the sleep timeout.- Returns:
trueif the sleep operation was not interrupted.- See Also:
Thread.sleep(long)
-
getContextClassLoader
public static java.lang.ClassLoader getContextClassLoader()
Gets the context ClassLoader of the current Thread or the system ClassLoader if none is set.- Returns:
- the context ClassLoader of the current Thread or the system ClassLoader if none is set.
-
-