| public class java.awt.event InvocationEvent
|
Java SE 6 |
run() method on a Runnable
when dispatched by the AWT event dispatcher thread. This class can
be used as a reference implementation of ActiveEvent rather
than declaring a new class and defining dispatch().
Instances of this class are placed on the EventQueue by calls
to invokeLater and invokeAndWait. Client code
can use this fact to write replacement functions for invokeLater
and invokeAndWait without writing special-case code
in any AWTEventListener objects.
| version | 1.21, 04/07/06 |
| since | 1.2 |
| See also | java.awt.ActiveEvent, invokeLater, invokeAndWait, java.awt.event.AWTEventListener |
| Fields | |
|---|---|
| final public static int | INVOCATION_FIRST Marks the first integer id for the range of invocation event ids. |
| final public static int | INVOCATION_DEFAULT The default id for all InvocationEvents. |
| final public static int | INVOCATION_LAST Marks the last integer id for the range of invocation event ids. |
| protected Runnable | runnable The Runnable whose run() method will be called. |
| protected Object | notifier The (potentially null) Object whose notifyAll() method will be called immediately after the Runnable.run() method returns. |
| protected boolean | catchExceptions Set to true if dispatch() catches Throwable and stores it in the exception instance variable. If false, Throwables are propagated up to the EventDispatchThread's dispatch loop. |
| Constructors | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public | InvocationEvent(Object source, Runnable runnable) Details
Constructs an InvocationEvent with the specified
source which will execute the runnable's run
method when dispatched.
This is a convenience constructor. An invocation of the form
InvocationEvent(source, runnable)
behaves in exactly the same way as the invocation of
This method throws an
| ||||||||||||
| public | InvocationEvent(Object source, Runnable runnable, Object notifier, boolean catchThrowables) Details
Constructs an InvocationEvent with the specified
source which will execute the runnable's run
method when dispatched. If notifier is non-null,
notifyAll() will be called on it
immediately after run returns.
An invocation of the form InvocationEvent(source,
runnable, notifier, catchThrowables)
behaves in exactly the same way as the invocation of
This method throws an
| ||||||||||||
| protected | InvocationEvent(Object source, int id, Runnable runnable, Object notifier, boolean catchThrowables) Details
Constructs an InvocationEvent with the specified
source and ID which will execute the runnable's run
method when dispatched. If notifier is non-null,
notifyAll will be called on it
immediately after run returns.
Note that passing in an invalid
| ||||||||||||
| Methods | |||
|---|---|---|---|
| public void | dispatch() Executes the Runnable's run() method and notifies the
notifier (if any) when run() returns.
| ||
| public String | paramString() Details
Returns a parameter string identifying this event.
This method is useful for event-logging and for debugging.
| ||
| Properties | |||||
|---|---|---|---|---|---|
| public Exception | getException() Details
Returns any Exception caught while executing the Runnable's run()
method.
| ||||
| public Throwable | getThrowable() Details
Returns any Throwable caught while executing the Runnable's run()
method.
| ||||
| public long | getWhen() Details
Returns the timestamp of when this event occurred.
| ||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2013 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|