aicas logo Jamaica 3.4 release 8

com.aicas.jamaica.lang
Class Wait

java.lang.Object
  extended by com.aicas.jamaica.lang.Wait

public class Wait
extends Object

Wait provides a handy method to wait for a monitor and ignore all interrupt()s.


Constructor Summary
Wait()
           
 
Method Summary
static void join(Thread thread)
          Wait for termination of a given thread.
static void sleep(long ms)
          Sleep for a given amount of time and ignore all interrupts() or ThreadDeath exceptions.
static void sleep(long ms, int ns)
          Sleep for a given amount of time and ignore all interrupts() or ThreadDeath exceptions.
static void wait(Object obj)
          Wait for a notify on a given object using obj.wait() and ignore all interrupts() or ThreadDeath exceptions.
static void wait(Object obj, long ms)
          Wait for a notify on a given object using obj.wait() and ignore all interrupts() or ThreadDeath exceptions.
static void wait(Object obj, long ms, int ns)
          Wait for a notify on a given object using obj.wait() and ignore all interrupts() or ThreadDeath exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Wait

public Wait()
Method Detail

wait

public static void wait(Object obj,
                        long ms,
                        int ns)
Wait for a notify on a given object using obj.wait() and ignore all interrupts() or ThreadDeath exceptions. Remember the interrupted() state in the current thread. This routine only returns after a notify occured or the timeout has expired. Any interrupt() that occured will be recored in the isInterrupted() state of the current thread.

Parameters:
obj - the object to wait for.
ms - the timeout in milliseconds, 0 for none.
ns - the timeout in nanoseconds, 0 for none.
Throws:
IllegalMonitorStateException - if the currrent thread did not enter obj's monitor.

wait

public static void wait(Object obj,
                        long ms)
Wait for a notify on a given object using obj.wait() and ignore all interrupts() or ThreadDeath exceptions. Remember the interrupted() state in the current thread. This routine only returns after a notify occured or the timeout has expired. Any interrupt() that occured will be recored in the isInterrupted() state of the current thread.

Parameters:
obj - the object to wait for.
ms - the timeout in milliseconds, 0 for none.
Throws:
IllegalMonitorStateException - if the currrent thread did not enter obj's monitor.

wait

public static void wait(Object obj)
Wait for a notify on a given object using obj.wait() and ignore all interrupts() or ThreadDeath exceptions. Remember the interrupted() state in the current thread. This routine only returns after a notify occured. Any interrupt() that occured will be recored in the isInterrupted() state of the current thread.

Parameters:
obj - the object to wait for.
Throws:
IllegalMonitorStateException - if the currrent thread did not enter obj's monitor.

sleep

public static void sleep(long ms,
                         int ns)
Sleep for a given amount of time and ignore all interrupts() or ThreadDeath exceptions. Remember the interrupted() state in the current thread.

Parameters:
ms - the timeout in milliseconds.
ns - the timeout in nanoseconds.
Throws:
IllegalArgumentException - if millis or nanos is negative or nanos is larger than 999999.

sleep

public static void sleep(long ms)
Sleep for a given amount of time and ignore all interrupts() or ThreadDeath exceptions. Remember the interrupted() state in the current thread.

Parameters:
ms - the timeout in milliseconds.
Throws:
IllegalArgumentException - if millis is negative.

join

public static void join(Thread thread)
Wait for termination of a given thread. This routine only returns after the thread has terminated. Any interrupt() that occured will be recored in the isInterrupted() state of the current thread.

Parameters:
thread - the thread whose termination we are waiting for.

aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.