anchor.diff:  <% end -%>
   
     @Override
  -  public void subscribeTo<%= graph.name %>(<%= update_param %><%= update_param.size > 0 ? ", #{suffix}" : suffix %>)
  +  public void subscribeTo<%= graph.name %>(<%= [graph_id_param, filter_param, std_param].compact.join(", ") %>)
     {
  -    final SubscriptionEntry<<%= repository.imit.qualified_graph_enum_name %>> entry =
  -      subscribeTo<%= subscribe_method %>Graph( <%= repository.imit.qualified_graph_enum_name %>.<%= Domgen::Naming.uppercase_constantize(graph.name) %><%= param_value %> );
  -    if( null != entry )
  -    {
  -      final Runnable runnable = new Runnable()
  -      {
  -        @Override
  -        public void run()
  -        {
  -          entry.markAsPresent();
  -          LOG.info( "subscribeTo<%= graph.name %>(<%= graph.instance_root? ? "\" + #{varname} + \"" : "" %>) completed." );
  -          if( null != action )
  -          {
  -            action.run();
  -          }
  -        }
  -      };
  -<% if graph.cacheable? -%>
  -      final org.realityforge.replicant.client.transport.CacheEntry cacheEntry = _context.getCacheService().lookup( <%= repository.imit.qualified_graph_enum_name %>.<%= Domgen::Naming.uppercase_constantize(graph.name) %>.name() );
  -      final String eTag = null != cacheEntry ? cacheEntry.getETag() : null;
  -      final String content = null != cacheEntry ? cacheEntry.getContent() : null;
  -      if( null != content )
  -      {
  -        LOG.info( "Found locally cached data for graph <%= graph.name %> with etag " + eTag + "." );
  -      }
  -      final Runnable cacheCurrentAction = new Runnable()
  -      {
  -        public void run()
  -        {
  -          assert null != content;
  -          LOG.info( "Loading cached data for graph <%= graph.name %> with etag " + eTag );
  -          //TODO: Figure out how to make the bulkLoad configurable
  -          _context.loadCachedContent( content, runnable, true );
  -        }
  -      };
  -<% end -%>
  -      LOG.info( "subscribeTo<%= graph.name %>(<%= graph.instance_root? ? "\" + #{varname} + \"" : "" %>) requested." );
  -      _context.remoteSubscribeTo<%= graph.name %>( <%= param_cache_value %><%= update_param_early_value %><%= update_param_early_value.size > 0 ? ', ' : '' %>runnable );
  -    }
  -<% if graph.filter_parameter -%>
  -    else
  -    {
  -      update<%= graph.name %>Subscription(<%= update_param_early_value %><%= update_param_early_value.size > 0 ? ', ' : '' %>action);
  -    }
  -<% end -%>
  +    subscribe( <%= key %>, <%= graph_id %>, <%= cache_key %>, <%= filter_var %>, action);
     }
   
   <% if graph.filter_parameter %>
  -  public void update<%= graph.name %>Subscription(<%= update_param %><%= update_param.size > 0 ? ", #{suffix}" : suffix %>)
  +  public void update<%= graph.name %>Subscription(<%= [graph_id_param, filter_param, std_param].compact.join(", ") %>)
     {
  -    final SubscriptionEntry<<%= repository.imit.qualified_graph_enum_name %>> entry =
  -      find<%= subscribe_method %>GraphSubscription( <%= repository.imit.qualified_graph_enum_name %>.<%= Domgen::Naming.uppercase_constantize(graph.name) %><%= param_value %> );
  -    if( null != entry )
  -    {
  -      final Runnable runnable = new Runnable()
  -      {
  -        @Override
  -        public void run()
  -        {
  -          entry.setSubscriptionUpdateInProgress( false );
  -          LOG.info( "update<%= graph.name %>Subscription(<%= graph.instance_root? ? "\" + #{varname} + \"" : "" %>) completed." );
  -          if( null != action )
  -          {
  -            action.run();
  -          }
  -        }
  -      };
  -      LOG.info( "update<%= graph.name %>Subscription(<%= graph.instance_root? ? "\" + #{varname} + \"" : "" %>) requested." );
  -      entry.setSubscriptionData( filter );
  -      entry.setSubscriptionUpdateInProgress( true );
  -      _context.remoteUpdate<%= graph.name %>Subscription( <%= update_param_early_value %><%= update_param_early_value.size > 0 ? ', ' : '' %>runnable );
  -    }
  -    else
  -    {
  -      LOG.warning( "update<%= graph.name %>Subscription(<%= graph.instance_root? ? "\" + #{varname} + \"" : "" %>) request but not currently subscribed." );
  -    }
  +    updateSubscription( <%= key %>, <%= graph_id %>, filter, action );
     }
   <% end %>
   
     @Override
  -  public void unsubscribeFrom<%= graph.name %>(<%= param %><%= param.size > 0 ? ", #{suffix}" : suffix %>)
  +  public void unsubscribeFrom<%= graph.name %>(<%= [graph_id_param, std_param].compact.join(", ") %>)
     {
  -    final SubscriptionEntry<<%= repository.imit.qualified_graph_enum_name %>> entry =
  -      unsubscribeFrom<%= subscribe_method %>Graph( <%= repository.imit.qualified_graph_enum_name %>.<%= Domgen::Naming.uppercase_constantize(graph.name) %><%= param_value %> );
  -    if( null != entry )
  -    {
  -      LOG.info( "unsubscribeFrom<%= graph.name %>(<%= graph.instance_root? ? "\" + #{varname} + \"" : "" %>) requested." );
  -      entry.markDeregisterInProgress();
  -      _context.remoteUnsubscribeFrom<%= graph.name %>( <%= param_early_value %><%= param_early_value.size > 0 ? ', ' : '' %>new Runnable()
  -      {
  -        @Override
  -        public void run()
  -        {
  -          entry.markAsDeregistered();
  -<% if !graph.instance_root? -%>
  -          unload<%= graph.name %>();
  -<%
  -  else
  -    entity = repository.entity_by_name(graph.instance_root)
  -%>
  -          final <%= entity.imit.qualified_name %> e = _context.getRepository().findByID( <%= entity.imit.qualified_name %>.class, <%= varname %> );
  -          if( null != e )
  -          {
  -            unload<%= graph.name %>_<%= entity.name %>( e );
  -          }
  -<% end %>
  -          LOG.info( "unsubscribeFrom<%= graph.name %>(<%= graph.instance_root? ? "\" + #{varname} + \"" : "" %>) completed." );
  -          if( null != action )
  -          {
  -            action.run();
  -          }
  -        }
  -      } );
  -    }
  -    else
  -    {
  -      LOG.info( "unsubscribeFrom<%= graph.name %>(<%= graph.instance_root? ? "\" + #{varname} + \"" : "" %>) requested but no such subscription." );
  -      if( null != action )
  -      {
  -        action.run();
  -      }
  -    }
  +    unsubscribe( <%= key %>, <%= graph_id %>, action );
     }
   
   <% if !graph.instance_root? -%>
     @Override
     public void unload<%= graph.name %>()
     {
  -    _context.getEntityChangeBroker().pause();
  +    _broker.pause();
   <%
     graph.type_roots.reverse.each do |root|
       entity = repository.entity_by_name(root)
   -%>
  -    for ( final <%= entity.imit.qualified_name %> e : _context.getRepository().findAll( <%= entity.imit.qualified_name %>.class ) )
  +    for ( final <%= entity.imit.qualified_name %> e : _repository.findAll( <%= entity.imit.qualified_name %>.class ) )
       {
  -      _context.getRepository().deregisterEntity( <%= entity.imit.qualified_name %>.class, e.get<%= entity.primary_key.name %>() );
  +      _repository.deregisterEntity( <%= entity.imit.qualified_name %>.class, e.get<%= entity.primary_key.name %>() );
       }
   <% end -%>
  -    _context.getEntityChangeBroker().resume();
  +    _broker.resume();
     }
   <% else %>
   <%
  
positive.code:   public java.util.Map<Object, SubscriptionEntry<<%= repository.imit.qualified_graph_enum_name %>>> get<%= graph.name %>Subscriptions()
    {
      final java.util.Map<Object, SubscriptionEntry<<%= repository.imit.qualified_graph_enum_name %>>> subscriptions =
        getInstanceSubscriptions().get( <%= repository.imit.qualified_graph_enum_name %>.<%= Domgen::Naming.uppercase_constantize(graph.name) %> );
      if ( null != subscriptions )
      {
        return java.util.Collections.unmodifiableMap( subscriptions );
  
negative.code: import org.realityforge.replicant.client.transport.SubscriptionEntry;
  
  public class <%= repository.imit.client_session_name %>
    extends org.realityforge.replicant.client.transport.ClientSession<<%= repository.imit.client_session_name %>, <%= repository.imit.qualified_graph_enum_name %>>
    implements <%= repository.imit.qualified_client_session_interface_name %>
  {
    private final org.realityforge.replicant.client.EntityRepository _repository;
    private final org.realityforge.replicant.client.EntityChangeBroker _broker;
  
    // TODO: We should generate  an abstract data loader that does unloads
    public <%= repository.imit.client_session_name %>( @javax.annotation.Nonnull final org.realityforge.replicant.client.transport.AbstractDataLoaderService<<%= repository.imit.client_session_name %>, <%= repository.imit.qualified_graph_enum_name %>> dataLoaderService, @javax.annotation.Nonnull final String sessionID, @javax.annotation.Nonnull final org.realityforge.replicant.client.EntityRepository repository, @javax.annotation.Nonnull final org.realityforge.replicant.client.EntityChangeBroker broker )
    {
      super( dataLoaderService, sessionID );
      _repository = repository;
      _broker = broker;
    }
  
  <%
  