package org.realityforge.replicant.client.runtime;

import java.util.Objects;
import javax.annotation.Nonnull;
import org.realityforge.replicant.client.EntityLocator;
import org.realityforge.replicant.client.EntitySubscriptionManager;

public abstract class ReplicantConnectionImpl
  implements ReplicantConnection
{
  private final EntityLocator _entityLocator;
  private final EntitySubscriptionManager _subscriptionManager;
  private final ReplicantClientSystem _replicantClientSystem;
  private final AreaOfInterestService _areaOfInterestService;
  private final ContextConverger _converger;

  public ReplicantConnectionImpl( @Nonnull final ContextConverger converger,
                                  @Nonnull final EntityLocator entityLocator,
                                  @Nonnull final EntitySubscriptionManager subscriptionManager,
                                  @Nonnull final ReplicantClientSystem replicantClientSystem,
                                  @Nonnull final AreaOfInterestService areaOfInterestService )
  {
    _areaOfInterestService = Objects.requireNonNull( areaOfInterestService );
    _entityLocator = Objects.requireNonNull( entityLocator );
    _subscriptionManager = Objects.requireNonNull( subscriptionManager );
    _replicantClientSystem = Objects.requireNonNull( replicantClientSystem );
    _converger = Objects.requireNonNull( converger );
  }

  @Override
  public void disconnect()
  {
    _converger.deactivate();
    _replicantClientSystem.deactivate();
  }

  @Override
  public void connect()
  {
    _replicantClientSystem.activate();
    _converger.activate();
  }

  @Nonnull
  @Override
  public AreaOfInterestService getAreaOfInterestService()
  {
    return _areaOfInterestService;
  }

  @Nonnull
  @Override
  public ContextConverger getContextConverger()
  {
    return _converger;
  }

  @Nonnull
  @Override
  public EntityLocator getEntityLocator()
  {
    return _entityLocator;
  }

  @Nonnull
  @Override
  public EntitySubscriptionManager getSubscriptionManager()
  {
    return _subscriptionManager;
  }

  @Nonnull
  @Override
  public ReplicantClientSystem getReplicantClientSystem()
  {
    return _replicantClientSystem;
  }
}

@@ -104,16 +104,75 @@
 onnull;%0A
+import javax.inject.Inject;%0Aimport javax.inject.Singleton;%0A
 import o
@@ -292,23 +292,25 @@
 r;%0A%0A
-public abstract
+@Singleton%0Apublic
  cla
@@ -651,16 +651,26 @@
 erger;%0A%0A
+  @Inject%0A
   public

Mark service as a singleton that can be injected