Class Linker

java.lang.Object
com.google.gwt.core.ext.Linker
Direct Known Subclasses:
AbstractLinker, SoycReportLinker

public abstract class Linker extends Object
Defines a linker for the GWT compiler. Each Linker must be annotated with a LinkerOrder annotation to determine the relative ordering of the Linkers. Exact order of Linker execution will be determined by the order of add-linker tags in the module configuration. Each Linker should also be annotated with Shardable; non-shardable linkers are deprecated and will eventually not be supported.

A new instance of a linker is created each time a module is compiled or during hosted mode when a module first loads (or is refreshed). During a compile, link(TreeLogger, LinkerContext, ArtifactSet) is called exactly once on each non-shardable linker, and the artifact set will contain any and all generated artifacts. For shardable linkers, link(TreeLogger, LinkerContext, ArtifactSet, boolean) is called once for each compiled permutation and once after all compiles are finished. The precise artifacts supplied differ with each call and are described in the method's documentation.

When hosted mode starts for a module, it calls link(TreeLogger, LinkerContext, ArtifactSet) for non-shardable linkers and link(TreeLogger, LinkerContext, ArtifactSet, boolean) for shardable ones, passing false as the onePermutation argument. If any artifacts are subsequently generated during the course of running hosted mode, relink(TreeLogger, LinkerContext, ArtifactSet) will be called with the new artifacts.