GeezerVison is showing docs.oracle.com — InvocationEvent (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
java.awt.event
Class InvocationEvent
-
-
Field Summary
Fields
| Modifier and Type |
Field |
Description |
protected boolean |
catchExceptions |
Set to true if dispatch() catches Throwable and stores it in the
exception instance variable.
|
static int |
INVOCATION_DEFAULT |
The default id for all InvocationEvents.
|
static int |
INVOCATION_FIRST |
Marks the first integer id for the range of invocation event ids.
|
static int |
INVOCATION_LAST |
Marks the last integer id for the range of invocation event ids.
|
protected Object |
notifier |
The (potentially null) Object whose notifyAll() method will be called
immediately after the Runnable.run() method has returned or thrown an exception
or after the event was disposed.
|
protected Runnable |
runnable |
The Runnable whose run() method will be called.
|
-
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK
-
Constructor Summary
Constructors
| Modifier |
Constructor |
Description |
protected |
InvocationEvent(Object source,
int id,
Runnable runnable,
Object notifier,
boolean catchThrowables) |
Constructs an InvocationEvent with the specified
source and ID which will execute the runnable's run
method when dispatched.
|
|
InvocationEvent(Object source,
Runnable runnable) |
Constructs an InvocationEvent with the specified
source which will execute the runnable's run
method when dispatched.
|
|
InvocationEvent(Object source,
Runnable runnable,
Object notifier,
boolean catchThrowables) |
Constructs an InvocationEvent with the specified
source which will execute the runnable's run
method when dispatched.
|
|
InvocationEvent(Object source,
Runnable runnable,
Runnable listener,
boolean catchThrowables) |
Constructs an InvocationEvent with the specified
source which will execute the runnable's run
method when dispatched.
|
-
Method Summary
All Methods Instance Methods Concrete Methods
| Modifier and Type |
Method |
Description |
void |
dispatch() |
Executes the Runnable's run() method and notifies the
notifier (if any) when run() has returned or thrown an exception.
|
Exception |
getException() |
Returns any Exception caught while executing the Runnable's run()
method.
|
Throwable |
getThrowable() |
Returns any Throwable caught while executing the Runnable's run()
method.
|
long |
getWhen() |
Returns the timestamp of when this event occurred.
|
boolean |
isDispatched() |
Returns true if the event is dispatched or any exception is
thrown while dispatching, false otherwise.
|
String |
paramString() |
Returns a parameter string identifying this event.
|
-
-
Field Detail
-
notifier
protected volatile Object notifier
The (potentially null) Object whose notifyAll() method will be called
immediately after the Runnable.run() method has returned or thrown an exception
or after the event was disposed.
- See Also:
isDispatched()
-
catchExceptions
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.
-
Constructor Detail
-
InvocationEvent
public InvocationEvent(Object source,
Runnable runnable,
Runnable listener,
boolean catchThrowables)
Constructs an InvocationEvent with the specified
source which will execute the runnable's run
method when dispatched. If listener is non- null,
listener.run() will be called immediately after
run has returned, thrown an exception or the event
was disposed.
This method throws an IllegalArgumentException
if source is null.
- Parameters:
source - The Object that originated
the event
runnable - The Runnable whose
run method will be
executed
listener - The RunnableRunnable whose
run() method will be called
after the InvocationEvent
was dispatched or disposed
catchThrowables - Specifies whether dispatch
should catch Throwable when executing
the Runnable's run
method, or should instead propagate those
Throwables to the EventDispatchThread's
dispatch loop
- Throws:
IllegalArgumentException - if source is null
-
InvocationEvent
protected InvocationEvent(Object source,
int id,
Runnable runnable,
Object notifier,
boolean catchThrowables)
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 has returned or thrown an exception.
This method throws an
IllegalArgumentException if source
is null.
- Parameters:
source - The Object that originated
the event
id - An integer indicating the type of event.
For information on allowable values, see
the class description for InvocationEvent
runnable - The Runnable whose
run method will be executed
notifier - The Object whose notifyAll
method will be called after
Runnable.run has returned or
thrown an exception or after the event was
disposed
catchThrowables - Specifies whether dispatch
should catch Throwable when executing the
Runnable's run
method, or should instead propagate those
Throwables to the EventDispatchThread's
dispatch loop
- Throws:
IllegalArgumentException - if source is null
- See Also:
EventObject.getSource(),
AWTEvent.getID()
Java™ Platform Standard Ed. 8
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|