org.cip4.jdflib.util
Class ThreadUtil

java.lang.Object
  extended by org.cip4.jdflib.util.ThreadUtil

public class ThreadUtil
extends Object

Author:
Rainer Prosi, Heidelberger Druckmaschinen

Nested Class Summary
static class ThreadUtil.MyMutex
          Deprecated. use org.cip4.jdflib.util.thread.MyMutex
static class ThreadUtil.WaitTimeout<a>
          abstract class to run uninteruptable stuff in an interruptable thread
 
Constructor Summary
ThreadUtil()
           
 
Method Summary
static boolean join(Thread thread, int millis)
          simple join wrapper that catches its exception
static void notify(Object mutex)
          simple notify that catches any and all exceptions
static void notifyAll(Object mutex)
          simple notify that catches any and all exceptions
static boolean sleep(int millis)
          simple sleep wrapper that catches its exception
static boolean wait(Object mutex, int millis)
          simple wait wrapper that synchronizes catches its exception
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadUtil

public ThreadUtil()
Method Detail

sleep

public static boolean sleep(int millis)
simple sleep wrapper that catches its exception

Parameters:
millis -
Returns:
true if normal exit, false if interupted

join

public static boolean join(Thread thread,
                           int millis)
simple join wrapper that catches its exception

Parameters:
thread - the thread to join
millis -
Returns:
true if normal exit, false if interupted

wait

public static boolean wait(Object mutex,
                           int millis)
simple wait wrapper that synchronizes catches its exception

Parameters:
mutex - the object that will wait, if null we assume we need not wait
millis - milliseconds to wait, 0 or lower: indefinite wait
Returns:
true if normal exit, false if interupted or mutex is null

notifyAll

public static void notifyAll(Object mutex)
simple notify that catches any and all exceptions

Parameters:
mutex - the mutex to notify

notify

public static void notify(Object mutex)
simple notify that catches any and all exceptions

Parameters:
mutex - the mutex to notify


Copyright © 2013. All Rights Reserved.