public final class WebErrorEvent extends Event
WebEngine error.
Holds an optional text message and an optional exception
associated with the error.WebEngine.onError,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static EventType<WebErrorEvent> |
ANY
Common supertype for all
WebErrorEvent types. |
static EventType<WebErrorEvent> |
USER_DATA_DIRECTORY_ALREADY_IN_USE
This event occurs when a
WebEngine detects that its
user data directory is already in use by a WebEngine
running in a different VM. |
static EventType<WebErrorEvent> |
USER_DATA_DIRECTORY_IO_ERROR
This event occurs when a
WebEngine encounters
an I/O error while trying to create or access the user
data directory. |
static EventType<WebErrorEvent> |
USER_DATA_DIRECTORY_SECURITY_ERROR
This event occurs when a
WebEngine encounters
a security error while trying to create or access the user
data directory. |
consumed, eventType, NULL_SOURCE_TARGET, targetsource| Constructor and Description |
|---|
WebErrorEvent(Object source,
EventType<WebErrorEvent> type,
String message,
Throwable exception)
Creates a new
WebErrorEvent. |
| Modifier and Type | Method and Description |
|---|---|
Throwable |
getException()
Returns the exception associated with this event.
|
String |
getMessage()
Returns the text message associated with this event.
|
String |
toString() |
clone, consume, copyFor, fireEvent, getEventType, getTarget, isConsumedgetSourcepublic static final EventType<WebErrorEvent> ANY
WebErrorEvent types.public static final EventType<WebErrorEvent> USER_DATA_DIRECTORY_ALREADY_IN_USE
WebEngine detects that its
user data directory is already in use by a WebEngine
running in a different VM.
In general, multiple WebEngine instances may share
a single user data directory as long as they run in the same
VM. WebEngine instances running in different VMs are
not allowed to share the same user data directory.
When a WebEngine is about to start loading a web
page or executing a script for the first time, it checks whether
its userDataDirectory
is already in use by a WebEngine running in a different
VM. If the latter is the case, the WebEngine invokes the
WebEngine.onError event handler,
if any, with a USER_DATA_DIRECTORY_ALREADY_IN_USE event.
If the invoked event handler modifies the userDataDirectory
property, the WebEngine retries with the new user
data directory as soon as the handler returns. If the handler
does not modify the userDataDirectory property (which
is the default), the WebEngine continues without the
user data directory.
public static final EventType<WebErrorEvent> USER_DATA_DIRECTORY_IO_ERROR
WebEngine encounters
an I/O error while trying to create or access the user
data directory.
When a WebEngine is about to start loading a web
page or executing a script for the first time, it checks whether
it can create or access its
userDataDirectory.
If the check fails with an I/O error (such as java.io.IOException), the WebEngine invokes the WebEngine.onError event handler,
if any, with a USER_DATA_DIRECTORY_IO_ERROR event.
If the invoked event handler modifies the userDataDirectory
property, the WebEngine retries with the new user
data directory as soon as the handler returns. If the handler
does not modify the userDataDirectory property (which
is the default), the WebEngine continues without the
user data directory.
public static final EventType<WebErrorEvent> USER_DATA_DIRECTORY_SECURITY_ERROR
WebEngine encounters
a security error while trying to create or access the user
data directory.
When a WebEngine is about to start loading a web
page or executing a script for the first time, it checks whether
it can create or access its
userDataDirectory.
If the check fails with a security error (such as java.lang.SecurityException), the WebEngine invokes the
WebEngine.onError event handler,
if any, with a USER_DATA_DIRECTORY_SECURITY_ERROR event.
If the invoked event handler modifies the userDataDirectory
property, the WebEngine retries with the new user
data directory as soon as the handler returns. If the handler
does not modify the userDataDirectory property (which
is the default), the WebEngine continues without the
user data directory.
public WebErrorEvent(Object source, EventType<WebErrorEvent> type, String message, Throwable exception)
WebErrorEvent.source - the event source which sent the eventeventType - the event typemessage - the text message associated with the event;
may be nullexception - the exception associated with the event;
may be nullpublic String getMessage()
null if there is no such messagepublic Throwable getException()
null if there is no such exceptionpublic String toString()
toString in class EventObjectCopyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.