de.schlichtherle.truezip.awt
Class EventQueueHelper
java.lang.Object
de.schlichtherle.truezip.awt.EventQueueHelper
@ThreadSafe
public class EventQueueHelper
- extends Object
Provide static utility methods for the AWT Event Queue.
- Author:
- Christian Schlichtherle
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RESET
private static final byte RESET
- See Also:
- Constant Field Values
CANCELLED
private static final byte CANCELLED
- See Also:
- Constant Field Values
STARTED
private static final byte STARTED
- See Also:
- Constant Field Values
DONE
private static final byte DONE
- See Also:
- Constant Field Values
EventQueueHelper
private EventQueueHelper()
invokeAndWaitUninterruptibly
public static void invokeAndWaitUninterruptibly(Runnable task)
throws InvocationTargetException
- Equivalent to
invokeAndWaitUninterruptibly(task, 0), but cannot throw an
EventDispatchTimeoutException.
- Throws:
InvocationTargetException
invokeAndWaitUninterruptibly
public static void invokeAndWaitUninterruptibly(Runnable task,
long startTimeout)
throws EventDispatchTimeoutException,
InvocationTargetException
- Invokes the given
task on the AWT Event Dispatching Thread
(EDT) and waits until it's finished.
If this method is called on the EDT itself, it will just invoke the
given task.
If the current thread gets interrupted while waiting for the EDT to
finish the task, then waiting is continued normally, but the current
thread's interrupt status is set upon return.
- Parameters:
task - The Runnable whose run
method should be executed synchronously in the EDT.startTimeout - If positive, then this parameter specifies the
maximum time to wait before the EDT starts to process
task in milliseconds.
- Throws:
IllegalArgumentException - If startTimeout is
negative.
EventDispatchTimeoutException - If startTimeout is
positive and waiting for the EDT to start processing the
task timed out.
The task has been cancelled, i.e. it will not be executed.
InvocationTargetException - If an exception is thrown when
running task.
getCause() yields the cause of this exception,
which must be a RuntimeException or an Error.- See Also:
Thread.interrupted()
invokeAndWait
private static void invokeAndWait(Runnable task,
boolean interruptibly,
long startTimeout)
throws EventDispatchTimeoutException,
InterruptedException,
InvocationTargetException
- Throws:
EventDispatchTimeoutException
InterruptedException
InvocationTargetException
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.