anchor.diff:    }
   <% if repository.arez? -%>
   
  -  private void setupArezLocator()
  +  private void registerArezLocator()
     {
       arez.Arez.context().registerLocator( ensureInjector().getLocator() );
     }
  
positive.code:   protected abstract void onAppcacheUpdateReadyEvent();
  <% end -%>
  
    protected void postStart()
    {
    }
  
    protected void preStart()
    {
    }
  
    protected void prepareServices()
    {
  <% if repository.imit? -%>
      replicant.WebStorageCacheService.install();
      elemental2.dom.DomGlobal.window.addEventListener( "beforeunload", e -> replicant.Replicant.context().deactivate(), true );
  <% end -%>
    }
  
    protected abstract void prepareUI();
  
    protected void onUncaughtException( @javax.annotation.Nonnull final Throwable e )
    {
  
negative.code:   }
  <% if repository.keycloak? -%>
  
    @javax.annotation.Nonnull
    public org.realityforge.gwt.keycloak.Keycloak getKeycloak()
    {
      return _keycloak;
    }
  
    @javax.annotation.Nonnull
    protected org.realityforge.gwt.keycloak.KeycloakListener newKeycloakListener()
    {
      return new ApplicationKeycloakListener();
    }
  
    protected class ApplicationKeycloakListener
      extends org.realityforge.gwt.keycloak.KeycloakListenerAdapter
    {
      @Override
      public void onReady( @javax.annotation.Nonnull final org.realityforge.gwt.keycloak.Keycloak keycloak, final boolean authenticated )
      {
        if ( authenticated )
        {
          start();
        }
        else
        {
          keycloak.login();
        }
      }
    }
  <% end -%>
  <% if repository.imit? -%>
  <% if repository.keycloak? -%>
  
    private void updateReplicantToken()
    {
      replicant.Replicant.context().setAuthToken( getKeycloak().getToken() );
    }
  
  <% end -%>
    private void registerReplicantConnector()
    {
      final replicant.WebSocketConfig config = replicant.WebSocketConfig.create( com.google.gwt.core.client.GWT.getHostPageBaseURL() + "api", getKeycloak() );
      replicant.Replicant.context().registerConnector( ensureInjector().getSystemSchema(), new replicant.WebSocketTransport( config ) );
    }
  
    private void prepareReplicant()
    {
      replicant.WebStorageCacheService.install();
      elemental2.dom.DomGlobal.window.addEventListener( "beforeunload", e -> replicant.Replicant.context().deactivate(), true );
  <% if repository.keycloak? -%>
      updateReplicantToken();
      elemental2.dom.DomGlobal.setInterval( e -> getKeycloak().updateToken( 30, this::updateReplicantToken ), 5000 );
  <% end -%>
    }
  <% end -%>
  }
  