Skip to content

Commit

Permalink
Rename ActorRef and InternalActorRef to IActorRef and IInternalActorRef
Browse files Browse the repository at this point in the history
  • Loading branch information
HCanber committed Mar 29, 2015
1 parent c4d88df commit 6ca2095
Show file tree
Hide file tree
Showing 206 changed files with 1,205 additions and 1,205 deletions.
4 changes: 2 additions & 2 deletions src/benchmark/PingPong/ClientActorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ namespace PingPong
{
public class ClientActorBase : ActorBase
{
private readonly ActorRef _actor;
private readonly IActorRef _actor;
private readonly TaskCompletionSource<bool> _latch;
private long _received;
private readonly long _repeat;
private long _sent;

public ClientActorBase(ActorRef actor, long repeat, TaskCompletionSource<bool> latch)
public ClientActorBase(IActorRef actor, long repeat, TaskCompletionSource<bool> latch)
{
_actor = actor;
_repeat = repeat;
Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/PingPong/ClientReceiveActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace PingPong
{
public class ClientReceiveActor : ReceiveActor
{
public ClientReceiveActor(ActorRef actor, long repeat, TaskCompletionSource<bool> latch)
public ClientReceiveActor(IActorRef actor, long repeat, TaskCompletionSource<bool> latch)
{
var received=0L;
var sent=0L;
Expand Down
2 changes: 1 addition & 1 deletion src/benchmark/PingPong/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private static async Task<Tuple<bool, long, int>> Benchmark<TActor>(int factor,

var countdown = new CountdownEvent(numberOfClients * 2);
var waitForStartsActor = system.ActorOf(Props.Create(() => new WaitForStarts(countdown)), "wait-for-starts");
var clients = new List<ActorRef>();
var clients = new List<IActorRef>();
var tasks = new List<Task>();
var started = new Messages.Started();
for(int i = 0; i < numberOfClients; i++)
Expand Down
6 changes: 3 additions & 3 deletions src/core/Akka.Cluster.Tests/AutoDownSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public override int GetHashCode()

class AutoDownTestActor : AutoDownBase
{
readonly ActorRef _probe;
readonly IActorRef _probe;

public AutoDownTestActor(TimeSpan autoDownUnreachableAfter, ActorRef probe): base(autoDownUnreachableAfter)
public AutoDownTestActor(TimeSpan autoDownUnreachableAfter, IActorRef probe): base(autoDownUnreachableAfter)
{
_probe = probe;
}
Expand Down Expand Up @@ -65,7 +65,7 @@ public override void Down(Address node)
}
}

private ActorRef AutoDownActor(TimeSpan autoDownUnreachableAfter)
private IActorRef AutoDownActor(TimeSpan autoDownUnreachableAfter)
{
return
Sys.ActorOf(new Props(typeof(AutoDownTestActor),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Akka.Cluster.Tests
{
public class ClusterDomainEventPublisherSpec : AkkaSpec
{
ActorRef _publisher;
IActorRef _publisher;
static readonly Member aUp = TestMember.Create(new Address("akka.tcp", "sys", "a", 2552), MemberStatus.Up);
static readonly Member aLeaving = aUp.Copy(status: MemberStatus.Leaving);
static readonly Member aExiting = aLeaving.Copy(status: MemberStatus.Exiting);
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Cluster.Tests/ClusterSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class ClusterSpec : AkkaSpec
akka.actor.provider = ""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster""
akka.remote.helios.tcp.port = 0";

public ActorRef Self { get { return TestActor; } }
public IActorRef Self { get { return TestActor; } }

readonly Address _selfAddress;
readonly Cluster _cluster;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Cluster.Tests/MetricsCollectorSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static class MetricsEnabledSpec

public class MetricsCollectorSpec : MetricsCollectorFactory, IDisposable
{
public ActorRef Self { get { return TestActor; } }
public IActorRef Self { get { return TestActor; } }

private readonly IMetricsCollector _collector;

Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Cluster.Tests/MetricsGossipSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Akka.Cluster.Tests
{
public class MetricsGossipSpec : MetricsCollectorFactory
{
public ActorRef Self { get { return TestActor; } }
public IActorRef Self { get { return TestActor; } }

private IMetricsCollector _collector;

Expand Down
14 changes: 7 additions & 7 deletions src/core/Akka.Cluster.Tests/MultiNode/ClusterDeathWatchSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ private ClusterDeathWatchSpec(ClusterDeathWatchSpecConfig config)
_config = config;
}

private ActorRef _remoteWatcher;
private IActorRef _remoteWatcher;

protected ActorRef RemoteWatcher
protected IActorRef RemoteWatcher
{
get
{
Expand Down Expand Up @@ -207,7 +207,7 @@ public void AnActorWatchingARemoteActorInTheClusterMustBeAbleToWatchActorBeforeN
AwaitAssert(() =>
{
RemoteWatcher.Tell(Remote.RemoteWatcher.Stats.Empty);
ExpectMsg<Remote.RemoteWatcher.Stats>().WatchingRefs.Contains(new Tuple<ActorRef, ActorRef>(subject5, TestActor)).ShouldBeTrue();
ExpectMsg<Remote.RemoteWatcher.Stats>().WatchingRefs.Contains(new Tuple<IActorRef, IActorRef>(subject5, TestActor)).ShouldBeTrue();
});
}, _config.First);
EnterBarrier("remote-watch");
Expand Down Expand Up @@ -331,10 +331,10 @@ public void AnActorWatchingARemoteActorInTheClusterMustBeAbleToShutdownSystemWhe
/// </summary>
class Observer : ReceiveActor
{
private readonly ActorRef _testActorRef;
private readonly IActorRef _testActorRef;
readonly TestLatch _watchEstablished;

public Observer(ActorPath path2, ActorPath path3, TestLatch watchEstablished, ActorRef testActorRef)
public Observer(ActorPath path2, ActorPath path3, TestLatch watchEstablished, IActorRef testActorRef)
{
_watchEstablished = watchEstablished;
_testActorRef = testActorRef;
Expand Down Expand Up @@ -364,9 +364,9 @@ public Observer(ActorPath path2, ActorPath path3, TestLatch watchEstablished, Ac

class DumbObserver : ReceiveActor
{
private readonly ActorRef _testActorRef;
private readonly IActorRef _testActorRef;

public DumbObserver(ActorPath path2, ActorRef testActorRef)
public DumbObserver(ActorPath path2, IActorRef testActorRef)
{
_testActorRef = testActorRef;

Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka.Cluster.Tests/MultiNode/MultiNodeClusterSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ public static EndAck Instance
}
}

readonly ActorRef _testActor;
readonly IActorRef _testActor;
readonly Address _target;

public EndActor(ActorRef testActor, Address target)
public EndActor(IActorRef testActor, Address target)
{
_testActor = testActor;
_target = target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected ClusterConsistentHashingGroupSpec(ClusterConsistentHashingGroupSpecCon
_config = config;
}

protected Routees CurrentRoutees(ActorRef router)
protected Routees CurrentRoutees(IActorRef router)
{
var routerAsk = router.Ask<Routees>(new GetRoutees(), GetTimeoutOrDefault(null));
return routerAsk.Result;
Expand All @@ -93,7 +93,7 @@ protected Routees CurrentRoutees(ActorRef router)
/// <summary>
/// Fills in the self address for local ActorRef
/// </summary>
protected Address FullAddress(ActorRef actorRef)
protected Address FullAddress(IActorRef actorRef)
{
if (string.IsNullOrEmpty(actorRef.Path.Address.Host) || !actorRef.Path.Address.Port.HasValue)
return Cluster.SelfAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,22 @@ protected ClusterConsistentHashingRouterSpec(ConsistentHashingRouterMultiNodeCon
_config = config;
}

private ActorRef _router1 = null;
private IActorRef _router1 = null;

protected ActorRef Router1
protected IActorRef Router1
{
get { return _router1 ?? (_router1 = CreateRouter1()); }
}

private ActorRef CreateRouter1()
private IActorRef CreateRouter1()
{
return
Sys.ActorOf(
Props.Create<ConsistentHashingRouterMultiNodeConfig.Echo>().WithRouter(FromConfig.Instance),
"router1");
}

protected Routees CurrentRoutees(ActorRef router)
protected Routees CurrentRoutees(IActorRef router)
{
var routerAsk = router.Ask<Routees>(new GetRoutees(), GetTimeoutOrDefault(null));
return routerAsk.Result;
Expand All @@ -96,14 +96,14 @@ protected Routees CurrentRoutees(ActorRef router)
/// <summary>
/// Fills in the self address for local ActorRef
/// </summary>
protected Address FullAddress(ActorRef actorRef)
protected Address FullAddress(IActorRef actorRef)
{
if (string.IsNullOrEmpty(actorRef.Path.Address.Host) || !actorRef.Path.Address.Port.HasValue)
return Cluster.SelfAddress;
return actorRef.Path.Address;
}

protected void AssertHashMapping(ActorRef router)
protected void AssertHashMapping(IActorRef router)
{
// it may take some time until router receives cluster member events
AwaitAssert(() =>
Expand All @@ -115,7 +115,7 @@ protected void AssertHashMapping(ActorRef router)
routerMembers.ShouldBe(Roles.Select(GetAddress).ToList());

router.Tell("a", TestActor);
var destinationA = ExpectMsg<ActorRef>();
var destinationA = ExpectMsg<IActorRef>();
router.Tell("a", TestActor);
ExpectMsg(destinationA);
}
Expand Down Expand Up @@ -162,7 +162,7 @@ protected void AClusterRouterWithConsistentHashingPoolMustSelectDestinationBased
RunOn(() =>
{
Router1.Tell(new ConsistentHashableEnvelope("A", "a"));
var destinationA = ExpectMsg<ActorRef>();
var destinationA = ExpectMsg<IActorRef>();
Router1.Tell(new ConsistentHashableEnvelope("AA", "a"));
ExpectMsg(destinationA);
}, _config.First);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public ClusterRouterSupervisorSpec()

class KillableActor : ReceiveActor
{
private readonly ActorRef TestActor;
private readonly IActorRef TestActor;

public KillableActor(ActorRef testActor)
public KillableActor(IActorRef testActor)
{
TestActor = testActor;
Receive<string>(s => s == "go away", s =>
Expand Down
20 changes: 10 additions & 10 deletions src/core/Akka.Cluster/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public Cluster(ActorSystemImpl system)
/// <summary>
/// Handles initialization logic for the <see cref="Cluster"/>
/// </summary>
private async Task<ActorRef> GetClusterCoreRef()
private async Task<IActorRef> GetClusterCoreRef()
{
var timeout = System.Settings.CreationTimeout;
try
{
return await _clusterDaemons.Ask<ActorRef>(InternalClusterAction.GetClusterCoreRef.Instance, timeout).ConfigureAwait(false);
return await _clusterDaemons.Ask<IActorRef>(InternalClusterAction.GetClusterCoreRef.Instance, timeout).ConfigureAwait(false);
}
catch (Exception ex)
{
Expand All @@ -105,7 +105,7 @@ private async Task<ActorRef> GetClusterCoreRef()
/// <param name="subscriber">The actor who'll receive the cluster domain events</param>
/// <param name="to"><see cref="ClusterEvent.IClusterDomainEvent"/> subclasses</param>
/// <remarks>A snapshot of <see cref="ClusterEvent.CurrentClusterState"/> will be sent to <see cref="subscriber"/> as the first message</remarks>
public void Subscribe(ActorRef subscriber, Type[] to)
public void Subscribe(IActorRef subscriber, Type[] to)
{
Subscribe(subscriber, ClusterEvent.SubscriptionInitialStateMode.InitialStateAsSnapshot, to);
}
Expand All @@ -121,7 +121,7 @@ public void Subscribe(ActorRef subscriber, Type[] to)
/// If set to <see cref="ClusterEvent.SubscriptionInitialStateMode.InitialStateAsSnapshot"/>
/// a snapshot of <see cref="ClusterEvent.CurrentClusterState"/> will be sent to <see cref="subscriber"/> as the first message. </param>
/// <param name="to"><see cref="ClusterEvent.IClusterDomainEvent"/> subclasses</param>
public void Subscribe(ActorRef subscriber, ClusterEvent.SubscriptionInitialStateMode initialStateMode, Type[] to)
public void Subscribe(IActorRef subscriber, ClusterEvent.SubscriptionInitialStateMode initialStateMode, Type[] to)
{
var val = _clusterCore;
_clusterCore.Tell(new InternalClusterAction.Subscribe(subscriber, initialStateMode, ImmutableHashSet.Create<Type>(to)));
Expand All @@ -130,15 +130,15 @@ public void Subscribe(ActorRef subscriber, ClusterEvent.SubscriptionInitialState
/// <summary>
/// Unsubscribe to all cluster domain events.
/// </summary>
public void Unsubscribe(ActorRef subscriber)
public void Unsubscribe(IActorRef subscriber)
{
Unsubscribe(subscriber,null);
}

/// <summary>
/// Unsubscribe to a specific type of cluster domain event
/// </summary>
public void Unsubscribe(ActorRef subscriber, Type to)
public void Unsubscribe(IActorRef subscriber, Type to)
{
_clusterCore.Tell(new InternalClusterAction.Unsubscribe(subscriber, to));
}
Expand All @@ -148,7 +148,7 @@ public void Unsubscribe(ActorRef subscriber, Type to)
/// If you want this to happen periodically, you can use the <see cref="Scheduler"/> to schedule
/// a call to this method. You can also call <see cref="State"/> directly for this information.
/// </summary>
public void SendCurrentClusterState(ActorRef receiver)
public void SendCurrentClusterState(IActorRef receiver)
{
_clusterCore.Tell(new InternalClusterAction.SendCurrentClusterState(receiver));
}
Expand Down Expand Up @@ -277,9 +277,9 @@ public void Shutdown()
}
}

readonly ActorRef _clusterDaemons;
ActorRef _clusterCore;
public ActorRef ClusterCore { get { return _clusterCore; } }
readonly IActorRef _clusterDaemons;
IActorRef _clusterCore;
public IActorRef ClusterCore { get { return _clusterCore; } }

public void LogInfo(string message)
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Cluster/ClusterActorRefProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public override void Init(ActorSystemImpl system)
Cluster.Get(system);
}

protected override ActorRef CreateRemoteWatcher(ActorSystemImpl system)
protected override IActorRef CreateRemoteWatcher(ActorSystemImpl system)
{
// make sure Cluster extension is initialized/loaded from init thread
Cluster.Get(system);
Expand Down
Loading

0 comments on commit 6ca2095

Please sign in to comment.