java.lang.Object | |
↳ | com.google.gwt.core.client.impl.XhrLoadingStrategy |
The standard loading strategy used in a web browser. The linker it is used
with should provide JavaScript-level functions to indicate how to handle
downloading and installing code. There is support to use XHR for the
download.
Linkers should always provide a function
__gwtStartLoadingFragment
. This function is called by
AsyncFragmentLoader with two arguments: an integer fragment number that needs
to be downloaded, and a one-argument loadFinished function. If the load
fails, that function should be called with a descriptive exception as the
argument. If the load succeeds, that function may also be called, so long as
it isn't called until the downloaded code has been installed.
If the mechanism for loading the contents of fragments is provided by the
linker, the __gwtStartLoadingFragment
function should return
null
or undefined
.
Alternatively, the function can return a URL designating from where the code
for the requested fragment can be downloaded. In that case, the linker should
also provide a function __gwtInstallCode
for actually installing
the code once it is downloaded. That function will be passed the loaded code
once it has been downloaded.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
XhrLoadingStrategy.RequestData | Since LoadingStrategy must support concurrent requests, including figuring which is which in the onLoadError handling, we need to keep track of this data for each outstanding request, which we index by xhr object. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Overridable for tests.
| |||||||||||
Call the linker-supplied
__gwtInstallCode method. | |||||||||||
Call the linker-supplied __gwtStartLoadingFragment function.
| |||||||||||
Error recovery from loading or installing code.
| |||||||||||
Makes a single load-and-install attempt.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.google.gwt.core.client.impl.AsyncFragmentLoader.LoadingStrategy
|
Overridable for tests.
Call the linker-supplied __gwtInstallCode
method. See the
class comment
for more details.
Call the linker-supplied __gwtStartLoadingFragment function. It should either start the download and return null or undefined, or it should return a URL that should be downloaded to get the code. If it starts the download itself, it can synchronously load it, e.g. from cache, if that makes sense.
Error recovery from loading or installing code.
request | the requestData of this request |
---|---|
e | exception of the error |
mayRetry | true if retrying might be helpful
|
Makes a single load-and-install attempt.