|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.core.client.impl.AsyncFragmentLoader
public class AsyncFragmentLoader
Low-level support to download an extra fragment of code. This should not be invoked directly by user code.
The fragments are numbered as follows, assuming there are m split points:
Since the precise way to load code depends on the linker, linkers should
specify a rebind of AsyncFragmentLoader.LoadingStrategy. The default rebind is
XhrLoadingStrategy.
| Nested Class Summary | |
|---|---|
static interface |
AsyncFragmentLoader.LoadingStrategy
A strategy for loading code fragments. |
static interface |
AsyncFragmentLoader.LoadTerminatedHandler
An interface for handlers of load completion. |
static interface |
AsyncFragmentLoader.Logger
A strategy for logging progress. |
static class |
AsyncFragmentLoader.LwmLabels
Labels used for runAsync lightweight metrics. |
static class |
AsyncFragmentLoader.StandardLogger
The standard logger used in a web browser. |
| Field Summary | |
|---|---|
static AsyncFragmentLoader |
BROWSER_LOADER
The standard instance of AsyncFragmentLoader used in a web browser. |
| Constructor Summary | |
|---|---|
AsyncFragmentLoader(int numEntries,
int[] initialLoadSequence,
AsyncFragmentLoader.LoadingStrategy loadingStrategy,
AsyncFragmentLoader.Logger logger)
|
|
| Method Summary | |
|---|---|
static void |
browserLoaderLeftoversFragmentHasLoaded()
A helper static method that invokes BROWSER_LOADER.leftoversFragmentHasLoaded(). |
void |
fragmentHasLoaded(int fragment)
Inform the loader that a fragment has now finished loading. |
void |
inject(int splitPoint,
AsyncFragmentLoader.LoadTerminatedHandler loadErrorHandler)
Requests a load of the code for the specified split point. |
boolean |
isAlreadyLoaded(int splitPoint)
|
boolean |
isLoading(int splitPoint)
|
void |
leftoversFragmentHasLoaded()
|
void |
logEventProgress(java.lang.String eventGroup,
java.lang.String type)
Log an event with the this instance was provided. |
void |
setPrefetchQueue(int... runAsyncSplitPoints)
Request that a sequence of split points be prefetched. |
void |
startPrefetching()
|
void |
stopPrefetching()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static AsyncFragmentLoader BROWSER_LOADER
null. In GWT, the parameters to this call
are rewritten by com.google.gwt.dev.jjs.impl.ReplaceRunAsyncs. So
this must be a method call of exactly two arguments, or that magic fails.
| Constructor Detail |
|---|
public AsyncFragmentLoader(int numEntries,
int[] initialLoadSequence,
AsyncFragmentLoader.LoadingStrategy loadingStrategy,
AsyncFragmentLoader.Logger logger)
| Method Detail |
|---|
public static void browserLoaderLeftoversFragmentHasLoaded()
public void fragmentHasLoaded(int fragment)
public void inject(int splitPoint,
AsyncFragmentLoader.LoadTerminatedHandler loadErrorHandler)
loadErrorHandler will be invoked. If it succeeds, then
the code will be installed, and the code is expected to invoke its own
on-success hooks, including a call to either
leftoversFragmentHasLoaded() or fragmentHasLoaded(int).
splitPoint - the split point whose code needs to be loadedpublic boolean isAlreadyLoaded(int splitPoint)
public boolean isLoading(int splitPoint)
public void leftoversFragmentHasLoaded()
public void logEventProgress(java.lang.String eventGroup,
java.lang.String type)
public void setPrefetchQueue(int... runAsyncSplitPoints)
splitPoints will be downloaded and installed
whenever there is nothing else to download. Each call to this method
overwrites the entire prefetch queue with the newly specified one.
public void startPrefetching()
public void stopPrefetching()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||