diff --git a/src/contrib/cluster/Akka.Cluster.Sharding.Tests/AllAtOnceEntityRecoveryStrategySpec.cs b/src/contrib/cluster/Akka.Cluster.Sharding.Tests/AllAtOnceEntityRecoveryStrategySpec.cs index 4596a88c200..ad1c33472ca 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding.Tests/AllAtOnceEntityRecoveryStrategySpec.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding.Tests/AllAtOnceEntityRecoveryStrategySpec.cs @@ -1,5 +1,5 @@ //----------------------------------------------------------------------- -// +// // Copyright (C) 2009-2016 Lightbend Inc. // Copyright (C) 2013-2016 Akka.NET project // diff --git a/src/contrib/cluster/Akka.Cluster.Sharding.Tests/ConstantRateEntityRecoveryStrategySpec.cs b/src/contrib/cluster/Akka.Cluster.Sharding.Tests/ConstantRateEntityRecoveryStrategySpec.cs index e133aaa9720..d9d29faf950 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding.Tests/ConstantRateEntityRecoveryStrategySpec.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding.Tests/ConstantRateEntityRecoveryStrategySpec.cs @@ -1,5 +1,5 @@ //----------------------------------------------------------------------- -// +// // Copyright (C) 2009-2016 Lightbend Inc. // Copyright (C) 2013-2016 Akka.NET project // diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/ClusterSharding.cs b/src/contrib/cluster/Akka.Cluster.Sharding/ClusterSharding.cs index 0a2c47ae37f..6aa0055948d 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/ClusterSharding.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/ClusterSharding.cs @@ -661,14 +661,15 @@ public IActorRef ShardRegion(string typeName) { return region; } - throw new ArgumentException(string.Format("Shard type [{0}] must be started first", typeName)); + throw new ArgumentException($"Shard type [{typeName}] must be started first"); } private void RequireClusterRole(string role) { if (!(string.IsNullOrEmpty(role) || _cluster.SelfRoles.Contains(role))) { - throw new IllegalStateException(string.Format("This cluster member [{0}] doesn't have the role [{1}]", _cluster.SelfAddress, role)); + throw new IllegalStateException( + $"This cluster member [{_cluster.SelfAddress}] doesn't have the role [{role}]"); } } } diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/EntityRecoveryStrategy.cs b/src/contrib/cluster/Akka.Cluster.Sharding/EntityRecoveryStrategy.cs index b5fdedea596..667351e22fc 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/EntityRecoveryStrategy.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/EntityRecoveryStrategy.cs @@ -1,5 +1,5 @@ //----------------------------------------------------------------------- -// +// // Copyright (C) 2009-2016 Lightbend Inc. // Copyright (C) 2013-2016 Akka.NET project // diff --git a/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/ClusterClient/ClusterClientStartSpecConfig.cs b/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/ClusterClient/ClusterClientStartSpecConfig.cs index 95f86be3d13..dede576d431 100644 --- a/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/ClusterClient/ClusterClientStartSpecConfig.cs +++ b/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/ClusterClient/ClusterClientStartSpecConfig.cs @@ -1,11 +1,16 @@ -using System.Collections.Generic; +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + using System.Collections.Immutable; using System.Linq; using Akka.Actor; using Akka.Cluster.TestKit; using Akka.Cluster.Tools.Client; using Akka.Cluster.Tools.PublishSubscribe; -using Akka.Cluster.Tools.PublishSubscribe.Internal; using Akka.Configuration; using Akka.Remote.TestKit; using FluentAssertions; diff --git a/src/contrib/persistence/Akka.Persistence.Sql.TestKit/SqlJournalConnectionFailureSpec.cs b/src/contrib/persistence/Akka.Persistence.Sql.TestKit/SqlJournalConnectionFailureSpec.cs index f3f8181aecc..b25bc84c0eb 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.TestKit/SqlJournalConnectionFailureSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Sql.TestKit/SqlJournalConnectionFailureSpec.cs @@ -1,9 +1,12 @@ -using System; +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + +using System; using System.Collections.Generic; -using System.Data.Common; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Akka.Actor; using Akka.Configuration; using Xunit; diff --git a/src/contrib/persistence/Akka.Persistence.Sql.TestKit/SqlSnapshotConnectionFailureSpec.cs b/src/contrib/persistence/Akka.Persistence.Sql.TestKit/SqlSnapshotConnectionFailureSpec.cs index 36a7489d0cf..8c5d99721ec 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.TestKit/SqlSnapshotConnectionFailureSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Sql.TestKit/SqlSnapshotConnectionFailureSpec.cs @@ -1,11 +1,15 @@ -using System; +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Akka.Actor; using Akka.Configuration; -using FluentAssertions; using Xunit; using Xunit.Abstractions; diff --git a/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/SqliteJournalConnectionFailureSpec.cs b/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/SqliteJournalConnectionFailureSpec.cs index c1b89ed48d5..a59d4cf4d09 100644 --- a/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/SqliteJournalConnectionFailureSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/SqliteJournalConnectionFailureSpec.cs @@ -1,11 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + using Akka.Configuration; using Akka.Persistence.Sql.TestKit; -using Akka.Util.Internal; using Xunit.Abstractions; namespace Akka.Persistence.Sqlite.Tests diff --git a/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/SqliteSnapshotStoreConnectionFailureSpec.cs b/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/SqliteSnapshotStoreConnectionFailureSpec.cs index 5a467b19009..6b901a51a23 100644 --- a/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/SqliteSnapshotStoreConnectionFailureSpec.cs +++ b/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/SqliteSnapshotStoreConnectionFailureSpec.cs @@ -1,11 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + using Akka.Configuration; using Akka.Persistence.Sql.TestKit; -using Akka.Util.Internal; using Xunit.Abstractions; namespace Akka.Persistence.Sqlite.Tests diff --git a/src/contrib/serializers/Akka.Serialization.Hyperion/IKnownTypesProvider.cs b/src/contrib/serializers/Akka.Serialization.Hyperion/IKnownTypesProvider.cs index 41d8be481ac..3a547926b6b 100644 --- a/src/contrib/serializers/Akka.Serialization.Hyperion/IKnownTypesProvider.cs +++ b/src/contrib/serializers/Akka.Serialization.Hyperion/IKnownTypesProvider.cs @@ -1,5 +1,5 @@ //----------------------------------------------------------------------- -// +// // Copyright (C) 2009-2016 Lightbend Inc. // Copyright (C) 2013-2016 Akka.NET project // diff --git a/src/contrib/transports/Akka.Remote.Transport.Helios/Properties/AssemblyInfo.cs b/src/contrib/transports/Akka.Remote.Transport.Helios/Properties/AssemblyInfo.cs index 8dd7b700e20..0d22eb5ac93 100644 --- a/src/contrib/transports/Akka.Remote.Transport.Helios/Properties/AssemblyInfo.cs +++ b/src/contrib/transports/Akka.Remote.Transport.Helios/Properties/AssemblyInfo.cs @@ -1,5 +1,13 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +#region copyright +// ----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2017 Akka.NET project +// +// ----------------------------------------------------------------------- +#endregion + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApproveCluster.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApproveCluster.approved.txt index 18128e55d0a..dbaca42f208 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApproveCluster.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApproveCluster.approved.txt @@ -286,7 +286,7 @@ namespace Akka.Cluster.Routing public override bool IsManagementMessage(object message) { } public override Akka.Actor.Props RoutingLogicController(Akka.Routing.RoutingLogic routingLogic) { } public override Akka.Util.ISurrogate ToSurrogate(Akka.Actor.ActorSystem system) { } - public override Akka.Routing.RouterConfig WithFallback(Akka.Routing.RouterConfig other) { } + public override Akka.Routing.RouterConfig WithFallback(Akka.Routing.RouterConfig routerConfig) { } } public sealed class ClusterRouterGroupSettings : Akka.Cluster.Routing.ClusterRouterSettingsBase { diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt index d1b099c8d73..e3f138c5498 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt @@ -74,7 +74,7 @@ namespace Akka.Remote "nstead. [1.1.2]")] public DeadlineFailureDetector(System.TimeSpan acceptableHeartbeatPause, Akka.Remote.Clock clock = null) { } public DeadlineFailureDetector(System.TimeSpan acceptableHeartbeatPause, System.TimeSpan heartbeatInterval, Akka.Remote.Clock clock = null) { } - public DeadlineFailureDetector(Akka.Configuration.Config config, Akka.Event.EventStream ev) { } + public DeadlineFailureDetector(Akka.Configuration.Config config, Akka.Event.EventStream eventStream) { } public override bool IsAvailable { get; } public override bool IsMonitoring { get; } public override void HeartBeat() { } diff --git a/src/core/Akka.Cluster.Tests/ActorRefProvidersConfigSpec.cs b/src/core/Akka.Cluster.Tests/ActorRefProvidersConfigSpec.cs index 0766580be98..4cd9bf77ca7 100644 --- a/src/core/Akka.Cluster.Tests/ActorRefProvidersConfigSpec.cs +++ b/src/core/Akka.Cluster.Tests/ActorRefProvidersConfigSpec.cs @@ -1,4 +1,11 @@ -using System; +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + +using System; using Akka.Actor; using Akka.Configuration; using Akka.Remote; diff --git a/src/core/Akka.Cluster/Gossip.cs b/src/core/Akka.Cluster/Gossip.cs index cd73eb9ffdf..3e4bf6f5644 100644 --- a/src/core/Akka.Cluster/Gossip.cs +++ b/src/core/Akka.Cluster/Gossip.cs @@ -122,6 +122,7 @@ public Gossip(ImmutableSortedSet members, GossipOverview overview) : thi /// TBD /// TBD /// TBD + /// TBD public Gossip(ImmutableSortedSet members, GossipOverview overview, VectorClock version) { _members = members; @@ -156,19 +157,24 @@ public Gossip Copy(ImmutableSortedSet members = null, GossipOverview ove private void AssertInvariants() { if (_members.Any(m => m.Status == MemberStatus.Removed)) - throw new ArgumentException(string.Format("Live members must not have status [Removed], got {0}", - _members.Where(m => m.Status == MemberStatus.Removed).Select(m => m.ToString()).Aggregate((a, b) => a + ", " + b))); + { + var members = string.Join(", ", _members.Where(m => m.Status == MemberStatus.Removed).Select(m => m.ToString())); + throw new ArgumentException($"Live members must not have status [Removed], got {members}", nameof(_members)); + } - var inReachabilityButNotMember = - _overview.Reachability.AllObservers.Except(_members.Select(m => m.UniqueAddress)); + var inReachabilityButNotMember = _overview.Reachability.AllObservers.Except(_members.Select(m => m.UniqueAddress)); if (!inReachabilityButNotMember.IsEmpty) - throw new ArgumentException("Nodes not part of cluster in reachability table, got {0}", - inReachabilityButNotMember.Select(a => a.ToString()).Aggregate((a, b) => a + ", " + b)); + { + var inreachability = string.Join(", ", inReachabilityButNotMember.Select(a => a.ToString())); + throw new ArgumentException($"Nodes not part of cluster in reachability table, got {inreachability}", nameof(_overview)); + } var seenButNotMember = _overview.Seen.Except(_members.Select(m => m.UniqueAddress)); if (!seenButNotMember.IsEmpty) - throw new ArgumentException("Nodes not part of cluster have marked the Gossip as seen, got {0}", - seenButNotMember.Select(a => a.ToString()).Aggregate((a, b) => a + ", " + b)); + { + var seen = string.Join(", ", seenButNotMember.Select(a => a.ToString())); + throw new ArgumentException($"Nodes not part of cluster have marked the Gossip as seen, got {seen}", nameof(_overview)); + } } //TODO: Serializer should ignore diff --git a/src/core/Akka.Cluster/Proto/ClusterMessageSerializer.cs b/src/core/Akka.Cluster/Proto/ClusterMessageSerializer.cs index b18f96aba16..e569f311476 100644 --- a/src/core/Akka.Cluster/Proto/ClusterMessageSerializer.cs +++ b/src/core/Akka.Cluster/Proto/ClusterMessageSerializer.cs @@ -31,11 +31,18 @@ public ClusterMessageSerializer(ExtendedActorSystem system) private const int BufferSize = 1024 * 4; + /// + /// Completely unique value to identify this implementation of Serializer, used to optimize network traffic + /// Values from 0 to 16 is reserved for Akka internal usage + /// public override int Identifier { get { return 5; } } + /// + /// Returns whether this serializer needs a manifest in the fromBinary method + /// public override bool IncludeManifest { get { return true; } @@ -44,6 +51,14 @@ public override bool IncludeManifest //must be lazy because serializer is initialized from Cluster extension constructor private Lazy _gossipTimeToLive; + /// + /// Serializes the given object into a byte array + /// + /// The object to serialize + /// + /// This exception is thrown when the specified object is not a cluster message. + /// + /// A byte array containing the serialized object public override byte[] ToBinary(object obj) { if (obj is ClusterHeartbeatSender.Heartbeat) return AddressToProtoByteArray(((ClusterHeartbeatSender.Heartbeat)obj).From); @@ -66,9 +81,18 @@ public override byte[] ToBinary(object obj) if (obj is InternalClusterAction.InitJoinAck) return AddressToProtoByteArray(((InternalClusterAction.InitJoinAck)obj).Address); if (obj is InternalClusterAction.InitJoinNack) return AddressToProtoByteArray(((InternalClusterAction.InitJoinNack)obj).Address); if(obj is InternalClusterAction.ExitingConfirmed) return UniqueAddressToProtoByteArray(((InternalClusterAction.ExitingConfirmed)obj).Address); - throw new ArgumentException(string.Format("Can't serialize object of type {0}", obj.GetType())); + throw new ArgumentException($"Can't serialize object of type {obj.GetType()}", nameof(obj)); } + /// + /// Deserializes a byte array into an object of type . + /// + /// The array containing the serialized object + /// The type of object contained in the array + /// + /// This exception is thrown when the specified type is not a cluster message. + /// + /// The object contained in the array public override object FromBinary(byte[] bytes, Type type) { if (type == typeof (InternalClusterAction.Join)) @@ -91,16 +115,18 @@ public override object FromBinary(byte[] bytes, Type type) if (type == typeof(InternalClusterAction.InitJoinNack)) return new InternalClusterAction.InitJoinNack(AddressFromBinary(bytes)); if (type == typeof(ClusterHeartbeatSender.Heartbeat)) return new ClusterHeartbeatSender.Heartbeat(AddressFromBinary(bytes)); if (type == typeof(ClusterHeartbeatSender.HeartbeatRsp)) return new ClusterHeartbeatSender.HeartbeatRsp(UniqueAddressFromBinary(bytes)); - if(type == typeof(InternalClusterAction.ExitingConfirmed)) return new InternalClusterAction.ExitingConfirmed(UniqueAddressFromBinary(bytes)); + if (type == typeof(InternalClusterAction.ExitingConfirmed)) return new InternalClusterAction.ExitingConfirmed(UniqueAddressFromBinary(bytes)); if (type == typeof(GossipStatus)) return GossipStatusFromBinary(bytes); if (type == typeof(GossipEnvelope)) return GossipEnvelopeFromBinary(bytes); - throw new ArgumentException("Ned a cluster message class to be able to deserialize bytes in ClusterSerializer."); + throw new ArgumentException("Need a cluster message class to be able to deserialize bytes in ClusterSerializer.", nameof(type)); } /// /// Compresses the protobuf message using GZIP compression /// + /// The message to compress + /// A byte array containing the compressed message public byte[] Compress(IMessageLite message) { using (var bos = new MemoryStream(BufferSize)) @@ -115,6 +141,8 @@ public byte[] Compress(IMessageLite message) /// /// Decompresses the protobuf message using GZIP compression /// + /// The array containing the message to decompress + /// A byte array containing the decompressed message public byte[] Decompress(byte[] bytes) { using(var input = new GZipStream(new MemoryStream(bytes), CompressionMode.Decompress)) @@ -155,7 +183,7 @@ private Address AddressFromProto(Msg.Address address) private Msg.Address.Builder AddressToProto(Address address) { if(string.IsNullOrEmpty(address.Host) || !address.Port.HasValue) - throw new ArgumentException(string.Format("Address [{0}] could not be serialized: host or port missing.", address), "address"); + throw new ArgumentException($"Address [{address}] could not be serialized: host or port missing.", nameof(address)); return Msg.Address.CreateBuilder() .SetSystem(address.System) @@ -260,7 +288,7 @@ private string GetSystem(Msg.Address address) private int MapWithErrorMessage(Dictionary map, T value, string unknown) { if (map.ContainsKey(value)) return map[value]; - throw new ArgumentException(string.Format("Unknown {0} [{1}] in cluster message", unknown, value)); + throw new ArgumentException($"Unknown {unknown} [{value}] in cluster message"); } private Msg.Join JoinToProto(UniqueAddress node, ImmutableHashSet roles) diff --git a/src/core/Akka.Cluster/Routing/ClusterRoutingConfig.cs b/src/core/Akka.Cluster/Routing/ClusterRoutingConfig.cs index 6f36af3a236..5e488e0f446 100644 --- a/src/core/Akka.Cluster/Routing/ClusterRoutingConfig.cs +++ b/src/core/Akka.Cluster/Routing/ClusterRoutingConfig.cs @@ -56,6 +56,7 @@ public ClusterRouterGroupSettings(int totalInstances, bool allowLocalRoutees, st /// TBD /// TBD /// TBD + /// TBD public ClusterRouterGroupSettings(int totalInstances, IEnumerable routeesPaths, bool allowLocalRoutees, string useRole = null) : base(totalInstances, allowLocalRoutees, useRole) { @@ -173,6 +174,7 @@ public abstract class ClusterRouterSettingsBase /// TBD /// TBD /// TBD + /// TBD protected ClusterRouterSettingsBase(int totalInstances, bool allowLocalRoutees, string useRole) { UseRole = useRole; @@ -246,6 +248,7 @@ public sealed class ClusterRouterPool : Pool /// /// TBD /// TBD + /// TBD public ClusterRouterPool(Pool local, ClusterRouterPoolSettings settings) : base(settings.AllowLocalRoutees ? settings.MaxInstancesPerNode : 0, local.Resizer, @@ -313,7 +316,7 @@ internal override RouterActor CreateRouterActor() } /// - /// TBD + /// Retrieve the strategy to use when supervising the pool. /// public override SupervisorStrategy SupervisorStrategy { @@ -324,11 +327,14 @@ public override SupervisorStrategy SupervisorStrategy } /// - /// TBD + /// Configure the current router with an auxiliary router for routes that it does not know how to handle. /// - /// TBD - /// TBD - /// TBD + /// The router to use as an auxiliary source. + /// + /// This exception is thrown when the specified router is another . + /// This configuration is not allowed. + /// + /// The router configured with the auxiliary information. public override RouterConfig WithFallback(RouterConfig routerConfig) { var otherClusterRouterPool = routerConfig as ClusterRouterPool; @@ -487,10 +493,10 @@ internal override RouterActor CreateRouterActor() } /// - /// TBD + /// Creates a router that is responsible for routing messages to routees within the provided . /// - /// TBD - /// TBD + /// The ActorSystem this router belongs to. + /// The newly created router tied to the given system. public override Router CreateRouter(ActorSystem system) { return Local.CreateRouter(system); @@ -541,23 +547,27 @@ public override bool IsManagementMessage(object message) } /// - /// TBD + /// Creates a surrogate representation of the current router. /// - /// TBD - /// TBD + /// The actor system that owns this router. + /// The surrogate representation of the current router. public override ISurrogate ToSurrogate(ActorSystem system) { return Local.ToSurrogate(system); } /// - /// TBD + /// Configure the current router with an auxiliary router for routes that it does not know how to handle. /// - /// TBD - /// TBD - public override RouterConfig WithFallback(RouterConfig other) + /// The router to use as an auxiliary source. + /// + /// This exception is thrown when the specified router is another . + /// This configuration is not allowed. + /// + /// The router configured with the auxiliary information. + public override RouterConfig WithFallback(RouterConfig routerConfig) { - var localFallback = other as ClusterRouterGroup; + var localFallback = routerConfig as ClusterRouterGroup; if (localFallback != null && (localFallback.Local is ClusterRouterGroup)) { throw new ConfigurationException("ClusterRouterGroup is not allowed to wrap a ClusterRouterGroup"); @@ -568,7 +578,7 @@ public override RouterConfig WithFallback(RouterConfig other) return Copy(Local.WithFallback(localFallback.Local).AsInstanceOf()); } - return Copy(Local.WithFallback(other).AsInstanceOf()); + return Copy(Local.WithFallback(routerConfig).AsInstanceOf()); } /// @@ -591,16 +601,20 @@ internal RouterConfig Copy(Group local = null, ClusterRouterGroupSettings settin internal abstract class ClusterRouterActor : RouterActor { /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD + /// The settings used to configure the router. + /// + /// This exception is thrown when this actor is configured as something other than a router or router. + /// protected ClusterRouterActor(ClusterRouterSettingsBase settings) { Settings = settings; if (!(Cell.RouterConfig is Pool) && !(Cell.RouterConfig is Group)) { - throw new ActorInitializationException(string.Format("Cluster router actor can only be used with Pool or Group, not with {0}", Cell.RouterConfig.GetType())); + throw new ActorInitializationException( + $"Cluster router actor can only be used with Pool or Group, not with {Cell.RouterConfig.GetType()}"); } Cluster = Cluster.Get(Context.System); @@ -646,12 +660,12 @@ protected override void PostStop() /// /// TBD /// - /// TBD + /// TBD /// TBD - public bool IsAvailable(Member m) + public bool IsAvailable(Member member) { - return m.Status == MemberStatus.Up && SatisfiesRole(m.Roles) && - (Settings.AllowLocalRoutees || m.Address != Cluster.SelfAddress); + return member.Status == MemberStatus.Up && SatisfiesRole(member.Roles) && + (Settings.AllowLocalRoutees || member.Address != Cluster.SelfAddress); } private bool SatisfiesRole(ImmutableHashSet memberRoles) @@ -785,10 +799,12 @@ internal class ClusterRouterGroupActor : ClusterRouterActor private readonly Group _group; /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD - /// TBD + /// The settings used to configure the router. + /// + /// This exception is thrown when this actor is configured as something other than a router. + /// public ClusterRouterGroupActor(ClusterRouterGroupSettings settings) : base(settings) { Settings = settings; @@ -799,7 +815,8 @@ public ClusterRouterGroupActor(ClusterRouterGroupSettings settings) : base(setti } else { - throw new ActorInitializationException(string.Format("ClusterRouterGroupActor can only be used with group, not {0}", Cell.RouterConfig.GetType())); + throw new ActorInitializationException( + $"ClusterRouterGroupActor can only be used with group, not {Cell.RouterConfig.GetType()}"); } UsedRouteePaths = Settings.AllowLocalRoutees @@ -898,11 +915,13 @@ internal class ClusterRouterPoolActor : ClusterRouterActor private readonly SupervisorStrategy _supervisorStrategy; /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD - /// TBD - /// TBD + /// The strategy used to supervise the pool. + /// The settings used to configure the router. + /// + /// This exception is thrown when this actor is configured as something other than a router. + /// public ClusterRouterPoolActor(SupervisorStrategy supervisorStrategy, ClusterRouterPoolSettings settings) : base(settings) { _supervisorStrategy = supervisorStrategy; @@ -915,15 +934,15 @@ public ClusterRouterPoolActor(SupervisorStrategy supervisorStrategy, ClusterRout } else { - throw new ActorInitializationException("RouterPoolActor can only be used with Pool, not " + - Cell.RouterConfig.GetType()); + throw new ActorInitializationException( + $"RouterPoolActor can only be used with Pool, not {Cell.RouterConfig.GetType()}"); } } /// - /// TBD + /// Retrieve the strategy used when supervising the pool. /// - /// TBD + /// The strategy used when supervising the pool protected override SupervisorStrategy SupervisorStrategy() { return _supervisorStrategy; diff --git a/src/core/Akka.MultiNodeTestRunner.Shared.Tests/MultiNodeTestRunnerDiscovery/DiscoveryCases.cs b/src/core/Akka.MultiNodeTestRunner.Shared.Tests/MultiNodeTestRunnerDiscovery/DiscoveryCases.cs index ed558608a43..ad0e8570ead 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared.Tests/MultiNodeTestRunnerDiscovery/DiscoveryCases.cs +++ b/src/core/Akka.MultiNodeTestRunner.Shared.Tests/MultiNodeTestRunnerDiscovery/DiscoveryCases.cs @@ -1,4 +1,11 @@ -using Akka.Remote.TestKit; +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + +using Akka.Remote.TestKit; namespace Akka.MultiNodeTestRunner.Shared.Tests.MultiNodeTestRunnerDiscovery { diff --git a/src/core/Akka.MultiNodeTestRunner.Shared.Tests/MultiNodeTestRunnerDiscovery/DiscoverySpec.cs b/src/core/Akka.MultiNodeTestRunner.Shared.Tests/MultiNodeTestRunnerDiscovery/DiscoverySpec.cs index 33bedd62586..ec529393884 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared.Tests/MultiNodeTestRunnerDiscovery/DiscoverySpec.cs +++ b/src/core/Akka.MultiNodeTestRunner.Shared.Tests/MultiNodeTestRunnerDiscovery/DiscoverySpec.cs @@ -1,4 +1,11 @@ -using System.Collections.Generic; +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + +using System.Collections.Generic; using System.Linq; using System.Reflection; using Xunit; diff --git a/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs b/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs index c7e4c0120b1..6148a2b868d 100644 --- a/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs +++ b/src/core/Akka.Persistence/Journal/PersistencePluginProxy.cs @@ -96,6 +96,7 @@ private class SnapshotStore : IPluginType /// TBD /// /// TBD + /// TBD public PersistencePluginProxy(Config config) { _config = config; @@ -105,12 +106,12 @@ public PersistencePluginProxy(Config config) else if (pluginId.Equals("akka.persistence.snapshot-store.proxy")) _pluginType = new SnapshotStore(); else - throw new ArgumentException(string.Format("Unknown plugin type: {0}.", pluginId)); + throw new ArgumentException($"Unknown plugin type: {pluginId}."); _initTimeout = config.GetTimeSpan("init-timeout"); var key = "target-" + _pluginType.Qualifier + "-plugin"; _targetPluginId = config.GetString(key); if (string.IsNullOrEmpty(_targetPluginId)) - throw new ArgumentException(string.Format("{0}.{1} must be defined.", pluginId, key)); + throw new ArgumentException($"{pluginId}.{key} must be defined."); _startTarget = config.GetBoolean("start-target-" + _pluginType.Qualifier); _selfAddress = ((ExtendedActorSystem) Context.System).Provider.DefaultAddress; @@ -171,9 +172,7 @@ private TimeoutException TimeoutException() { return new TimeoutException( - string.Format( - "Target {0} not initialized. Use `PersistencePluginProxy.SetTargetLocation` or set `target-{0}-address`.", - _pluginType.Qualifier)); + $"Target {_pluginType.Qualifier} not initialized. Use `PersistencePluginProxy.SetTargetLocation` or set `target-{_pluginType.Qualifier}-address`."); } /// diff --git a/src/core/Akka.Remote.TestKit/Conductor.cs b/src/core/Akka.Remote.TestKit/Conductor.cs index 5e58cb244c7..a4475b9e7a1 100644 --- a/src/core/Akka.Remote.TestKit/Conductor.cs +++ b/src/core/Akka.Remote.TestKit/Conductor.cs @@ -189,7 +189,8 @@ public Task Abort(RoleName node, RoleName target) /// /// is the symbolic name of the node which is to be affected /// is the return code which shall be given to System.exit - /// + /// TBD + /// TBD public Task Exit(RoleName node, int exitValue) { // the recover is needed to handle ClientDisconnectedException exception, @@ -200,7 +201,7 @@ public Task Exit(RoleName node, int exitValue) var failure = t.Result as FSMBase.Failure; if (failure != null && failure.Cause is Controller.ClientDisconnectedException) return Done.Instance; - throw new InvalidOperationException(String.Format("Expected Done but received {0}", t.Result)); + throw new InvalidOperationException($"Expected Done but received {t.Result}"); }); } @@ -210,8 +211,9 @@ public Task Exit(RoleName node, int exitValue) /// removed, so that the remaining nodes may still pass subsequent barriers. /// /// is the symbolic name of the node which is to be affected - /// - /// + /// TBD + /// TBD + /// TBD public Task Shutdown(RoleName node, bool abort = false) { // the recover is needed to handle ClientDisconnectedException exception, @@ -222,7 +224,7 @@ public Task Shutdown(RoleName node, bool abort = false) var failure = t.Result as FSMBase.Failure; if (failure != null && failure.Cause is Controller.ClientDisconnectedException) return Done.Instance; - throw new InvalidOperationException(String.Format("Expected Done but received {0}", t.Result)); + throw new InvalidOperationException($"Expected Done but received {t.Result}"); }); } diff --git a/src/core/Akka.Remote.Tests/Transport/DotNettyTransportDnsResolutionSpec.cs b/src/core/Akka.Remote.Tests/Transport/DotNettyTransportDnsResolutionSpec.cs index 68be4a2ce16..02a0f483e9a 100644 --- a/src/core/Akka.Remote.Tests/Transport/DotNettyTransportDnsResolutionSpec.cs +++ b/src/core/Akka.Remote.Tests/Transport/DotNettyTransportDnsResolutionSpec.cs @@ -1,5 +1,5 @@ //----------------------------------------------------------------------- -// +// // Copyright (C) 2009-2016 Lightbend Inc. // Copyright (C) 2013-2016 Akka.NET project // diff --git a/src/core/Akka.Remote/AckedDelivery.cs b/src/core/Akka.Remote/AckedDelivery.cs index 28c731093aa..2abbb4e4534 100644 --- a/src/core/Akka.Remote/AckedDelivery.cs +++ b/src/core/Akka.Remote/AckedDelivery.cs @@ -355,12 +355,15 @@ public Ack(SeqNo cumulativeAck, IEnumerable nacks) public SortedSet Nacks { get; private set; } /// - /// TBD + /// Returns a that represents this instance. /// - /// TBD + /// + /// A that represents this instance. + /// public override string ToString() { - return string.Format("ACK[{0}, {1}]", CumulativeAck, String.Join(",", Nacks.Select(x => x.ToString()))); + var nacks = string.Join(",", Nacks.Select(x => x.ToString())); + return $"ACK[{CumulativeAck}, {nacks}]"; } } @@ -374,7 +377,7 @@ class ResendBufferCapacityReachedException : AkkaException /// /// The capacity of the buffer public ResendBufferCapacityReachedException(int c) - : base(string.Format("Resent buffer capacity of {0} has been reached.", c)) + : base($"Resent buffer capacity of {c} has been reached.") { } @@ -472,7 +475,7 @@ public AckedSendBuffer Acknowledge(Ack ack) /// The updated buffer. public AckedSendBuffer Buffer(T msg) { - if (msg.Seq <= MaxSeq) throw new ArgumentException(String.Format("Sequence number must be monotonic. Received {0} which is smaller than {1}", msg.Seq, MaxSeq)); + if (msg.Seq <= MaxSeq) throw new ArgumentException($"Sequence number must be monotonic. Received {msg.Seq} which is smaller than {MaxSeq}", nameof(msg)); if (NonAcked.Count == Capacity) throw new ResendBufferCapacityReachedException(Capacity); @@ -480,12 +483,15 @@ public AckedSendBuffer Buffer(T msg) } /// - /// TBD + /// Returns a that represents this instance. /// - /// TBD + /// + /// A that represents this instance. + /// public override string ToString() { - return string.Format("[{0}]", string.Join(",", NonAcked.Select(x => x.ToString()))); + var nonAcked = string.Join(",", NonAcked.Select(x => x.ToString())); + return $"[{nonAcked}]"; } #region Copy methods @@ -550,7 +556,7 @@ sealed class AckedReceiveBuffer where T : IHasSequenceNumber /// /// TBD /// - public readonly static SeqNo.HasSeqNoComparer Comparer = new SeqNo.HasSeqNoComparer(); + public static readonly SeqNo.HasSeqNoComparer Comparer = new SeqNo.HasSeqNoComparer(); /// /// Constructor diff --git a/src/core/Akka.Remote/Deadline.cs b/src/core/Akka.Remote/Deadline.cs index ca8c8f9aa34..a7b91fb2e63 100644 --- a/src/core/Akka.Remote/Deadline.cs +++ b/src/core/Akka.Remote/Deadline.cs @@ -10,21 +10,21 @@ namespace Akka.Remote { /// - /// Import of the scala.concurrent.duration.Deadline class + /// This class represents the latest date or time by which an operation should be completed. /// public class Deadline { /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD + /// The that the deadline is due. public Deadline(DateTime when) { When = when; } /// - /// TBD + /// Determines whether the deadline has past. /// public bool IsOverdue { @@ -32,7 +32,7 @@ public bool IsOverdue } /// - /// TBD + /// Determines whether there is still time left until the deadline. /// public bool HasTimeLeft { @@ -40,22 +40,29 @@ public bool HasTimeLeft } /// - /// TBD + /// The that the deadline is due. /// public DateTime When { get; private set; } /// + /// + /// The amount of time left until the deadline is reached. + /// + /// /// Warning: creates a new instance each time it's used + /// /// public TimeSpan TimeLeft { get { return When - DateTime.UtcNow; } } #region Overrides /// - /// TBD + /// Determines whether the specified , is equal to this instance. /// - /// TBD - /// TBD + /// The to compare with this instance. + /// + /// true if the specified is equal to this instance; otherwise, false. + /// public override bool Equals(object obj) { var deadlineObj = ((Deadline) obj); @@ -68,9 +75,11 @@ public override bool Equals(object obj) } /// - /// TBD + /// Returns a hash code for this instance. /// - /// TBD + /// + /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + /// public override int GetHashCode() { return When.GetHashCode(); @@ -82,7 +91,7 @@ public override int GetHashCode() #region Static members /// - /// Returns a deadline that is due + /// A deadline that is due /// public static Deadline Now { @@ -95,9 +104,9 @@ public static Deadline Now /// /// Adds a given to the due time of this /// - /// TBD - /// TBD - /// TBD + /// The deadline whose time is being extended + /// The amount of time being added to the deadline + /// A new deadline with the specified duration added to the due time public static Deadline operator +(Deadline deadline, TimeSpan duration) { return new Deadline(deadline.When.Add(duration)); @@ -106,9 +115,9 @@ public static Deadline Now /// /// Adds a given to the due time of this /// - /// TBD - /// TBD - /// TBD + /// The deadline whose time is being extended + /// The amount of time being added to the deadline + /// A new deadline with the specified duration added to the due time public static Deadline operator +(Deadline deadline, TimeSpan? duration) { if (duration.HasValue) @@ -118,7 +127,5 @@ public static Deadline Now } #endregion - } } - diff --git a/src/core/Akka.Remote/DeadlineFailureDetector.cs b/src/core/Akka.Remote/DeadlineFailureDetector.cs index 55963f69f72..5407e91eb31 100644 --- a/src/core/Akka.Remote/DeadlineFailureDetector.cs +++ b/src/core/Akka.Remote/DeadlineFailureDetector.cs @@ -13,8 +13,8 @@ namespace Akka.Remote { /// - /// Implementation of failure detector using an absolute timeout of missing heartbeats - /// to trigger unavailability + /// This class represents a that uses an absolute timeout + /// of missing heartbeats to trigger unavailability. /// public class DeadlineFailureDetector : FailureDetector { @@ -25,10 +25,10 @@ public class DeadlineFailureDetector : FailureDetector private readonly long _deadlineMillis; /// - /// TBD + /// Obsolete. Use instead. /// - /// TBD - /// TBD + /// N/A + /// N/A [Obsolete("Use DeadlineFailureDetector(acceptableHeartbeatPause, heartbeatInterval, clock) instead. [1.1.2]")] public DeadlineFailureDetector(TimeSpan acceptableHeartbeatPause, Clock clock = null) : this(acceptableHeartbeatPause, TimeSpan.Zero, clock) @@ -36,14 +36,21 @@ public DeadlineFailureDetector(TimeSpan acceptableHeartbeatPause, Clock clock = } /// - /// Procedural constructor for + /// Initializes a new instance of the class. /// /// Duration corresponding to number of potentially lost/delayed /// heartbeats that will be accepted before considering it to be an anomaly. /// This margin is important to be able to survive sudden, occasional, pauses in heartbeat /// arrivals, due to for example garbage collect or network drop. - /// + /// The amount of time between heartbeats /// The clock, returning current time in milliseconds, but can be faked for testing purposes. It is only used for measuring intervals (duration). + /// + /// This exception is thrown for the following reasons: + ///
    + ///
  • The specified is less than zero.
  • + ///
  • The specified is less than zero
  • + ///
+ ///
public DeadlineFailureDetector( TimeSpan acceptableHeartbeatPause, TimeSpan heartbeatInterval, @@ -51,12 +58,12 @@ public DeadlineFailureDetector( { if (acceptableHeartbeatPause <= TimeSpan.Zero) { - throw new ArgumentException("failure-detector.acceptable-heartbeat-pause must be >= 0s"); + throw new ArgumentOutOfRangeException(nameof(acceptableHeartbeatPause), "failure-detector.acceptable-heartbeat-pause must be >= 0s"); } if (heartbeatInterval <= TimeSpan.Zero) { - throw new ArgumentException("failure-detector.heartbeat-interval must be > 0s"); + throw new ArgumentOutOfRangeException(nameof(heartbeatInterval), "failure-detector.heartbeat-interval must be > 0s"); } _clock = clock ?? DefaultClock; @@ -64,18 +71,20 @@ public DeadlineFailureDetector( } /// - /// Constructor that reads parameters from an Akka section. - /// Expects property 'acceptable-heartbeat-pause'. + /// Initializes a new instance of the class. /// - /// TBD - /// TBD - public DeadlineFailureDetector(Config config, EventStream ev) + /// + /// The configuration used to configure this failure detector. + /// The configuration must define the 'akka.cluster.failure-detector.acceptable-heartbeat-pause' key. + /// + /// N/A. This parameter is not used. + public DeadlineFailureDetector(Config config, EventStream eventStream) : this( config.GetTimeSpan("acceptable-heartbeat-pause"), config.GetTimeSpan("heartbeat-interval")) { } /// - /// TBD + /// Determines whether the resource is considered to be up and healthy. /// public override bool IsAvailable => IsAvailableTicks(_clock()); @@ -86,12 +95,12 @@ private bool IsAvailableTicks(long timestamp) } /// - /// TBD + /// Determines whether the failure detector has received any heartbeats or has started monitoring the resource. /// public override bool IsMonitoring => _active; /// - /// TBD + /// Notifies the failure detector that a heartbeat arrived from the monitored resource. /// public override void HeartBeat() { diff --git a/src/core/Akka.Remote/Endpoint.cs b/src/core/Akka.Remote/Endpoint.cs index c6e012e089e..2fea5b53c39 100644 --- a/src/core/Akka.Remote/Endpoint.cs +++ b/src/core/Akka.Remote/Endpoint.cs @@ -182,17 +182,17 @@ public void Dispatch(IInternalActorRef recipient, Address recipientAddress, Seri internal class EndpointException : AkkaException { /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD - /// TBD - public EndpointException(string msg, Exception cause = null) : base(msg, cause) { } + /// The message that describes the error. + /// The exception that is the cause of the current exception. + public EndpointException(string message, Exception cause = null) : base(message, cause) { } /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD - /// TBD + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. protected EndpointException(SerializationInfo info, StreamingContext context) : base(info, context) { @@ -313,11 +313,11 @@ public HopelessAssociation(Address localAddress, Address remoteAddress, int? uid internal sealed class EndpointDisassociatedException : EndpointException { /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD - public EndpointDisassociatedException(string msg) - : base(msg) + /// The message that describes the error. + public EndpointDisassociatedException(string message) + : base(message) { } } @@ -328,20 +328,20 @@ public EndpointDisassociatedException(string msg) internal sealed class EndpointAssociationException : EndpointException { /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD - public EndpointAssociationException(string msg) - : base(msg) + /// The message that describes the error. + public EndpointAssociationException(string message) + : base(message) { } /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD - /// TBD - public EndpointAssociationException(string msg, Exception inner) : base(msg, inner) { } + /// The message that describes the error. + /// The exception that is the cause of the current exception. + public EndpointAssociationException(string message, Exception innerException) : base(message, innerException) { } } /// @@ -350,11 +350,11 @@ public EndpointAssociationException(string msg, Exception inner) : base(msg, inn internal sealed class OversizedPayloadException : EndpointException { /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD - public OversizedPayloadException(string msg) - : base(msg) + /// The message that describes the error. + public OversizedPayloadException(string message) + : base(message) { } } diff --git a/src/core/Akka.Remote/EndpointManager.cs b/src/core/Akka.Remote/EndpointManager.cs index e78c4ce482e..d4b98c503d1 100644 --- a/src/core/Akka.Remote/EndpointManager.cs +++ b/src/core/Akka.Remote/EndpointManager.cs @@ -1103,16 +1103,18 @@ private TaskTBD /// TBD /// TBD - /// TBD + /// + /// This exception is thrown for the following reasons: + ///
    + ///
  • The specified is less than one.
  • + ///
  • The specified is less than zero.
  • + ///
  • The specified is less than zero.
  • + ///
+ ///
public HeartbeatHistory(int maxSampleSize, List intervals, long intervalSum, long squaredIntervalSum) { _maxSampleSize = maxSampleSize; @@ -303,11 +310,11 @@ public HeartbeatHistory(int maxSampleSize, List intervals, long intervalSu _squaredIntervalSum = squaredIntervalSum; if (maxSampleSize < 1) - throw new ArgumentOutOfRangeException("maxSampleSize", string.Format("maxSampleSize must be >= 1, got {0}", maxSampleSize)); + throw new ArgumentOutOfRangeException(nameof(maxSampleSize), $"maxSampleSize must be >= 1, got {maxSampleSize}"); if (intervalSum < 0L) - throw new ArgumentOutOfRangeException("intervalSum", string.Format("intervalSum must be >= 0, got {0}", intervalSum)); + throw new ArgumentOutOfRangeException(nameof(intervalSum), $"intervalSum must be >= 0, got {intervalSum}"); if (squaredIntervalSum < 0L) - throw new ArgumentOutOfRangeException("squaredIntervalSum", string.Format("squaredIntervalSum must be >= 0, got {0}", squaredIntervalSum)); + throw new ArgumentOutOfRangeException(nameof(squaredIntervalSum), $"squaredIntervalSum must be >= 0, got {squaredIntervalSum}"); } /// diff --git a/src/core/Akka.Remote/Proto/Containerformats.cs b/src/core/Akka.Remote/Proto/Containerformats.cs index 3cd1425e21d..64bc0eaea2a 100644 --- a/src/core/Akka.Remote/Proto/Containerformats.cs +++ b/src/core/Akka.Remote/Proto/Containerformats.cs @@ -1,3 +1,10 @@ +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + // Generated by ProtoGen, Version=2.4.1.521, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! #pragma warning disable 1591, 0612, 3021 #region Designer generated code diff --git a/src/core/Akka.Remote/Proto/Wireformats.cs b/src/core/Akka.Remote/Proto/Wireformats.cs index a4390acbd61..f3cc07c02cf 100644 --- a/src/core/Akka.Remote/Proto/Wireformats.cs +++ b/src/core/Akka.Remote/Proto/Wireformats.cs @@ -1,3 +1,10 @@ +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + // Generated by ProtoGen, Version=2.4.1.521, Culture=neutral, PublicKeyToken=55f7125234beb589. DO NOT EDIT! #pragma warning disable 1591, 0612, 3021 #region Designer generated code diff --git a/src/core/Akka.Remote/RemoteActorRefProvider.cs b/src/core/Akka.Remote/RemoteActorRefProvider.cs index 49fb1ab8226..0498f22100e 100644 --- a/src/core/Akka.Remote/RemoteActorRefProvider.cs +++ b/src/core/Akka.Remote/RemoteActorRefProvider.cs @@ -308,9 +308,7 @@ public IInternalActorRef ActorOf(ActorSystemImpl system, Props props, IInternalA catch (Exception ex) { throw new ConfigurationException( - string.Format( - "Configuration problem while creating {0} with dispatcher [{1}] and mailbox [{2}]", path, - props.Dispatcher, props.Mailbox), ex); + $"Configuration problem while creating {path} with dispatcher [{props.Dispatcher}] and mailbox [{props.Mailbox}]", ex); } var localAddress = Transport.LocalAddressForRemote(addr); var rpath = (new RootActorPath(addr) / "remote" / localAddress.Protocol / localAddress.HostPort() / @@ -321,7 +319,7 @@ public IInternalActorRef ActorOf(ActorSystemImpl system, Props props, IInternalA } catch (Exception ex) { - throw new ActorInitializationException(string.Format("Remote deployment failed for [{0}]", path), ex); + throw new ActorInitializationException($"Remote deployment failed for [{path}]", ex); } } diff --git a/src/core/Akka.Remote/RemoteSettings.cs b/src/core/Akka.Remote/RemoteSettings.cs index c98904298ec..2c2dbd33590 100644 --- a/src/core/Akka.Remote/RemoteSettings.cs +++ b/src/core/Akka.Remote/RemoteSettings.cs @@ -14,14 +14,14 @@ namespace Akka.Remote { /// - /// TBD + /// This class represents configuration information used when setting up remoting. /// public class RemoteSettings { /// - /// TBD + /// Initializes a new instance of the class. /// - /// TBD + /// The configuration to use when setting up remoting. public RemoteSettings(Config config) { //TODO: need to add value validation for each field diff --git a/src/core/Akka.Remote/Routing/RemoteRouterConfig.cs b/src/core/Akka.Remote/Routing/RemoteRouterConfig.cs index 9eb2c802ac0..4296113e26f 100644 --- a/src/core/Akka.Remote/Routing/RemoteRouterConfig.cs +++ b/src/core/Akka.Remote/Routing/RemoteRouterConfig.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Linq; using Akka.Actor; +using Akka.Configuration; using Akka.Routing; using Akka.Util; using Akka.Util.Internal; @@ -26,14 +27,17 @@ public sealed class RemoteRouterConfig : Pool, IEquatable private readonly AtomicCounter _childNameCounter = new AtomicCounter(); /// - /// TBD + /// Initializes a new instance of the class. /// /// TBD /// TBD + /// + /// This exception is thrown when the enumeration of specified nodes is empty. + /// public RemoteRouterConfig(Pool local, IEnumerable
nodes) : base(local.NrOfInstances,local.Resizer,local.SupervisorStrategy,local.RouterDispatcher,local.UsePoolDispatcher) { - if (!nodes.Any()) throw new ArgumentException("Must specify list of remote target nodes.", "nodes"); + if (!nodes.Any()) throw new ArgumentException("Must specify list of remote target nodes.", nameof(nodes)); Local = local; Nodes = nodes.ToList(); @@ -51,10 +55,10 @@ public RemoteRouterConfig(Pool local, IEnumerable
nodes) internal IList
Nodes { get; } /// - /// TBD + /// Creates a router that is responsible for routing messages to routees within the provided . /// - /// TBD - /// TBD + /// The ActorSystem this router belongs to. + /// The newly created router tied to the given system. public override Router CreateRouter(ActorSystem system) { return Local.CreateRouter(system); @@ -102,7 +106,7 @@ internal override RouterActor CreateRouterActor() } /// - /// TBD + /// Retrieve the strategy to use when supervising the pool. /// public override SupervisorStrategy SupervisorStrategy { @@ -110,7 +114,7 @@ public override SupervisorStrategy SupervisorStrategy } /// - /// TBD + /// Dispatcher ID to use for running the “head” actor, which handles supervision, death watch and router management messages. /// public override string RouterDispatcher { @@ -118,7 +122,7 @@ public override string RouterDispatcher } /// - /// TBD + /// Retrieve the resizer to use when dynamically allocating routees to the pool. /// public override Resizer Resizer { @@ -126,16 +130,19 @@ public override Resizer Resizer } /// - /// TBD + /// Configures the current router with an auxiliary router for routes that it does not know how to handle. /// - /// TBD - /// TBD - /// TBD + /// The router to use as an auxiliary source. + /// + /// This exception is thrown when the specified router is another . + /// This configuration is not allowed. + /// + /// The router configured with the auxiliary information. public override RouterConfig WithFallback(RouterConfig routerConfig) { var other = routerConfig as RemoteRouterConfig; if (other != null && other.Local is RemoteRouterConfig) - throw new ArgumentException("RemoteRouterConfig is not allowed to wrap a RemoteRouterConfig", "routerConfig"); + throw new ConfigurationException("RemoteRouterConfig is not allowed to wrap a RemoteRouterConfig"); if (other != null && other.Local != null) return Copy(Local.WithFallback(other.Local).AsInstanceOf()); return Copy(Local.WithFallback(routerConfig).AsInstanceOf()); @@ -147,10 +154,10 @@ private RouterConfig Copy(Pool local = null, IEnumerable
nodes = null) } /// - /// TBD + /// Determines whether the specified router, is equal to this instance. /// - /// TBD - /// TBD + /// The group to compare. + /// true if the specified router is equal to this instance; otherwise, false. public bool Equals(RouterConfig other) { if (!base.Equals(other)) return false; @@ -161,10 +168,10 @@ public bool Equals(RouterConfig other) } /// - /// TBD + /// Creates a surrogate representation of the current router. /// - /// TBD - /// TBD + /// The actor system that owns this router. + /// The surrogate representation of the current router. public override ISurrogate ToSurrogate(ActorSystem system) { return new RemoteRouterConfigSurrogate @@ -175,7 +182,8 @@ public override ISurrogate ToSurrogate(ActorSystem system) } /// - /// TBD + /// This class represents a surrogate of a router. + /// Its main use is to help during the serialization process. /// public class RemoteRouterConfigSurrogate : ISurrogate { @@ -189,10 +197,10 @@ public class RemoteRouterConfigSurrogate : ISurrogate public Address[] Nodes { get; set; } /// - /// TBD + /// Creates a encapsulated by this surrogate. /// - /// TBD - /// TBD + /// The actor system that owns this router. + /// The encapsulated by this surrogate. public ISurrogated FromSurrogate(ActorSystem system) { return new RemoteRouterConfig(Local, Nodes); diff --git a/src/core/Akka.Remote/Transport/AkkaPduCodec.cs b/src/core/Akka.Remote/Transport/AkkaPduCodec.cs index 346a4f864cb..a82cafc3be5 100644 --- a/src/core/Akka.Remote/Transport/AkkaPduCodec.cs +++ b/src/core/Akka.Remote/Transport/AkkaPduCodec.cs @@ -472,7 +472,7 @@ private IAkkaPdu DecodeControlPdu(AkkaControlMessage controlPdu) return new Heartbeat(); } - throw new PduCodecException(string.Format("Decoding of control PDU failed, invalid format, unexpected {0}", controlPdu)); + throw new PduCodecException($"Decoding of control PDU failed, invalid format, unexpected {controlPdu}"); } @@ -521,7 +521,8 @@ private ActorRefData SerializeActorRef(Address defaultAddress, IActorRef actorRe private AddressData SerializeAddress(Address address) { - if (string.IsNullOrEmpty(address.Host) || !address.Port.HasValue) throw new ArgumentException(string.Format("Address {0} could not be serialized: host or port missing", address)); + if (string.IsNullOrEmpty(address.Host) || !address.Port.HasValue) + throw new ArgumentException($"Address {address} could not be serialized: host or port missing"); return AddressData.CreateBuilder() .SetHostname(address.Host) .SetPort((uint)address.Port.Value) diff --git a/src/core/Akka.Remote/Transport/TestTransport.cs b/src/core/Akka.Remote/Transport/TestTransport.cs index cb9b353dad8..6696f9fe746 100644 --- a/src/core/Akka.Remote/Transport/TestTransport.cs +++ b/src/core/Akka.Remote/Transport/TestTransport.cs @@ -193,7 +193,7 @@ private async Task DefaultAssociate(Address remoteAddress) return (AssociationHandle) localHandle; } - throw new InvalidAssociationException(string.Format("No registered transport: {0}", remoteAddress)); + throw new InvalidAssociationException($"No registered transport: {remoteAddress}"); } private Tuple CreateHandlePair(TestTransport remoteTransport, @@ -430,8 +430,8 @@ public DisassociateAttempt(Address requestor, Address remote) /// currently active behavior. The bottom of the stack always contains the which /// can not be popped out. ///
- /// - /// + /// + /// public class SwitchableLoggedBehavior { private readonly ConcurrentStack>> _behaviorStack = diff --git a/src/core/Akka.Remote/Transport/TransportAdapters.cs b/src/core/Akka.Remote/Transport/TransportAdapters.cs index e982fa67829..27329642f83 100644 --- a/src/core/Akka.Remote/Transport/TransportAdapters.cs +++ b/src/core/Akka.Remote/Transport/TransportAdapters.cs @@ -103,7 +103,7 @@ private Dictionary AdaptersTable() } catch (Exception ex) { - throw new ArgumentException(string.Format("Cannot initiate transport adapter {0}", adapter.Value), ex); + throw new ArgumentException($"Cannot initiate transport adapter {adapter.Value}", ex); } } @@ -123,7 +123,7 @@ public ITransportAdapterProvider GetAdapterProvider(string name) return _adaptersTable[name]; } - throw new ArgumentException(string.Format("There is no registered transport adapter provider with name {0}", name)); + throw new ArgumentException($"There is no registered transport adapter provider with name {name}"); } } diff --git a/src/core/Akka.Tests.Performance/Actor/ActorThroughputSpec.cs b/src/core/Akka.Tests.Performance/Actor/ActorThroughputSpec.cs index b86faabaed0..10430f7f84a 100644 --- a/src/core/Akka.Tests.Performance/Actor/ActorThroughputSpec.cs +++ b/src/core/Akka.Tests.Performance/Actor/ActorThroughputSpec.cs @@ -1,5 +1,5 @@ //----------------------------------------------------------------------- -// +// // Copyright (C) 2009-2016 Lightbend Inc. // Copyright (C) 2013-2016 Akka.NET project // diff --git a/src/core/Akka.Tests.Performance/Actor/Internal/ChildrenContainerSpec.cs b/src/core/Akka.Tests.Performance/Actor/Internal/ChildrenContainerSpec.cs index 2a0d924d45e..abca36735f1 100644 --- a/src/core/Akka.Tests.Performance/Actor/Internal/ChildrenContainerSpec.cs +++ b/src/core/Akka.Tests.Performance/Actor/Internal/ChildrenContainerSpec.cs @@ -1,4 +1,11 @@ -using Akka.Actor; +//----------------------------------------------------------------------- +// +// Copyright (C) 2009-2016 Lightbend Inc. +// Copyright (C) 2013-2016 Akka.NET project +// +//----------------------------------------------------------------------- + +using Akka.Actor; using Akka.Actor.Internal; using Akka.Util.Internal; using NBench; diff --git a/src/core/Akka/Pattern/BackoffSupervisorBase.cs b/src/core/Akka/Pattern/BackoffSupervisorBase.cs index 393d774d4a4..ec75672bfd0 100644 --- a/src/core/Akka/Pattern/BackoffSupervisorBase.cs +++ b/src/core/Akka/Pattern/BackoffSupervisorBase.cs @@ -1,13 +1,11 @@ //----------------------------------------------------------------------- -// +// // Copyright (C) 2009-2016 Lightbend Inc. // Copyright (C) 2013-2016 Akka.NET project // //----------------------------------------------------------------------- using Akka.Actor; -using Akka.Event; -using System; namespace Akka.Pattern { diff --git a/src/core/Akka/Routing/TailChopping.cs b/src/core/Akka/Routing/TailChopping.cs index 8029654d5a3..a1d769e906c 100644 --- a/src/core/Akka/Routing/TailChopping.cs +++ b/src/core/Akka/Routing/TailChopping.cs @@ -129,7 +129,7 @@ public override void Send(object message, IActorRef sender) { completion.TrySetResult( new Status.Failure( - new AskTimeoutException(String.Format("Ask timed out on {0} after {1}", sender, _within)))); + new AskTimeoutException($"Ask timed out on {sender} after {_within}"))); } }, cancelable); }