com.google.gwt.core.client.impl
Class XhrLoadingStrategy

java.lang.Object
  extended by com.google.gwt.core.client.impl.XhrLoadingStrategy
All Implemented Interfaces:
AsyncFragmentLoader.LoadingStrategy

public class XhrLoadingStrategy
extends java.lang.Object
implements AsyncFragmentLoader.LoadingStrategy

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.


Constructor Summary
XhrLoadingStrategy()
           
 
Method Summary
 void startLoadingFragment(int fragment, AsyncFragmentLoader.LoadTerminatedHandler loadErrorHandler)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XhrLoadingStrategy

public XhrLoadingStrategy()
Method Detail

startLoadingFragment

public void startLoadingFragment(int fragment,
                                 AsyncFragmentLoader.LoadTerminatedHandler loadErrorHandler)
Specified by:
startLoadingFragment in interface AsyncFragmentLoader.LoadingStrategy