Skip to content

Commit dbb8b58

Browse files
authored
[Obsolete][CS0618]ActorProducerPipeline* (#6495)
* [Obsolete][CS0618]`ActorProducerPipeline*` "Actor producer pipeline API will be removed in v1.5." - ActorProducerPipelineResolver - ActorProducerPluginBase * Change the APIs
1 parent 1c3fee8 commit dbb8b58

8 files changed

+9
-31
lines changed

src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Core.verified.txt

-6
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ namespace Akka.Actor
220220
public override int GetHashCode() { }
221221
}
222222
}
223-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
224223
public class ActorProducerPipeline : System.Collections.Generic.IEnumerable<Akka.Actor.IActorProducerPlugin>, System.Collections.IEnumerable
225224
{
226225
public ActorProducerPipeline(System.Lazy<Akka.Event.ILoggingAdapter> log, System.Collections.Generic.IEnumerable<Akka.Actor.IActorProducerPlugin> plugins) { }
@@ -229,7 +228,6 @@ namespace Akka.Actor
229228
public void BeforeActorIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context) { }
230229
public System.Collections.Generic.IEnumerator<Akka.Actor.IActorProducerPlugin> GetEnumerator() { }
231230
}
232-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
233231
public class ActorProducerPipelineResolver
234232
{
235233
public ActorProducerPipelineResolver(System.Func<Akka.Event.ILoggingAdapter> logBuilder) { }
@@ -239,15 +237,13 @@ namespace Akka.Actor
239237
public bool Register(Akka.Actor.IActorProducerPlugin plugin) { }
240238
public bool Unregister(Akka.Actor.IActorProducerPlugin plugin) { }
241239
}
242-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
243240
public abstract class ActorProducerPluginBase : Akka.Actor.IActorProducerPlugin
244241
{
245242
protected ActorProducerPluginBase() { }
246243
public virtual void AfterIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context) { }
247244
public virtual void BeforeIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context) { }
248245
public virtual bool CanBeAppliedTo(System.Type actorType) { }
249246
}
250-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
251247
public abstract class ActorProducerPluginBase<TActor> : Akka.Actor.IActorProducerPlugin
252248
where TActor : Akka.Actor.ActorBase
253249
{
@@ -718,7 +714,6 @@ namespace Akka.Actor
718714
public abstract class ExtendedActorSystem : Akka.Actor.ActorSystem
719715
{
720716
protected ExtendedActorSystem() { }
721-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
722717
public abstract Akka.Actor.ActorProducerPipelineResolver ActorPipelineResolver { get; }
723718
public abstract Akka.Actor.IInternalActorRef Guardian { get; }
724719
public abstract Akka.Actor.IInternalActorRef LookupRoot { get; }
@@ -953,7 +948,6 @@ namespace Akka.Actor
953948
void Stop(Akka.Actor.IActorRef child);
954949
void UnbecomeStacked();
955950
}
956-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
957951
public interface IActorProducerPlugin
958952
{
959953
void AfterIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context);

src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.DotNet.verified.txt

-6
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ namespace Akka.Actor
220220
public override int GetHashCode() { }
221221
}
222222
}
223-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
224223
public class ActorProducerPipeline : System.Collections.Generic.IEnumerable<Akka.Actor.IActorProducerPlugin>, System.Collections.IEnumerable
225224
{
226225
public ActorProducerPipeline(System.Lazy<Akka.Event.ILoggingAdapter> log, System.Collections.Generic.IEnumerable<Akka.Actor.IActorProducerPlugin> plugins) { }
@@ -229,7 +228,6 @@ namespace Akka.Actor
229228
public void BeforeActorIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context) { }
230229
public System.Collections.Generic.IEnumerator<Akka.Actor.IActorProducerPlugin> GetEnumerator() { }
231230
}
232-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
233231
public class ActorProducerPipelineResolver
234232
{
235233
public ActorProducerPipelineResolver(System.Func<Akka.Event.ILoggingAdapter> logBuilder) { }
@@ -239,15 +237,13 @@ namespace Akka.Actor
239237
public bool Register(Akka.Actor.IActorProducerPlugin plugin) { }
240238
public bool Unregister(Akka.Actor.IActorProducerPlugin plugin) { }
241239
}
242-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
243240
public abstract class ActorProducerPluginBase : Akka.Actor.IActorProducerPlugin
244241
{
245242
protected ActorProducerPluginBase() { }
246243
public virtual void AfterIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context) { }
247244
public virtual void BeforeIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context) { }
248245
public virtual bool CanBeAppliedTo(System.Type actorType) { }
249246
}
250-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
251247
public abstract class ActorProducerPluginBase<TActor> : Akka.Actor.IActorProducerPlugin
252248
where TActor : Akka.Actor.ActorBase
253249
{
@@ -719,7 +715,6 @@ namespace Akka.Actor
719715
public abstract class ExtendedActorSystem : Akka.Actor.ActorSystem
720716
{
721717
protected ExtendedActorSystem() { }
722-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
723718
public abstract Akka.Actor.ActorProducerPipelineResolver ActorPipelineResolver { get; }
724719
public abstract Akka.Actor.IInternalActorRef Guardian { get; }
725720
public abstract Akka.Actor.IInternalActorRef LookupRoot { get; }
@@ -955,7 +950,6 @@ namespace Akka.Actor
955950
void Stop(Akka.Actor.IActorRef child);
956951
void UnbecomeStacked();
957952
}
958-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
959953
public interface IActorProducerPlugin
960954
{
961955
void AfterIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context);

src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Net.verified.txt

-6
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,6 @@ namespace Akka.Actor
220220
public override int GetHashCode() { }
221221
}
222222
}
223-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
224223
public class ActorProducerPipeline : System.Collections.Generic.IEnumerable<Akka.Actor.IActorProducerPlugin>, System.Collections.IEnumerable
225224
{
226225
public ActorProducerPipeline(System.Lazy<Akka.Event.ILoggingAdapter> log, System.Collections.Generic.IEnumerable<Akka.Actor.IActorProducerPlugin> plugins) { }
@@ -229,7 +228,6 @@ namespace Akka.Actor
229228
public void BeforeActorIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context) { }
230229
public System.Collections.Generic.IEnumerator<Akka.Actor.IActorProducerPlugin> GetEnumerator() { }
231230
}
232-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
233231
public class ActorProducerPipelineResolver
234232
{
235233
public ActorProducerPipelineResolver(System.Func<Akka.Event.ILoggingAdapter> logBuilder) { }
@@ -239,15 +237,13 @@ namespace Akka.Actor
239237
public bool Register(Akka.Actor.IActorProducerPlugin plugin) { }
240238
public bool Unregister(Akka.Actor.IActorProducerPlugin plugin) { }
241239
}
242-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
243240
public abstract class ActorProducerPluginBase : Akka.Actor.IActorProducerPlugin
244241
{
245242
protected ActorProducerPluginBase() { }
246243
public virtual void AfterIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context) { }
247244
public virtual void BeforeIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context) { }
248245
public virtual bool CanBeAppliedTo(System.Type actorType) { }
249246
}
250-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
251247
public abstract class ActorProducerPluginBase<TActor> : Akka.Actor.IActorProducerPlugin
252248
where TActor : Akka.Actor.ActorBase
253249
{
@@ -718,7 +714,6 @@ namespace Akka.Actor
718714
public abstract class ExtendedActorSystem : Akka.Actor.ActorSystem
719715
{
720716
protected ExtendedActorSystem() { }
721-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
722717
public abstract Akka.Actor.ActorProducerPipelineResolver ActorPipelineResolver { get; }
723718
public abstract Akka.Actor.IInternalActorRef Guardian { get; }
724719
public abstract Akka.Actor.IInternalActorRef LookupRoot { get; }
@@ -953,7 +948,6 @@ namespace Akka.Actor
953948
void Stop(Akka.Actor.IActorRef child);
954949
void UnbecomeStacked();
955950
}
956-
[System.ObsoleteAttribute("Actor producer pipeline API will be removed in v1.5.")]
957951
public interface IActorProducerPlugin
958952
{
959953
void AfterIncarnated(Akka.Actor.ActorBase actor, Akka.Actor.IActorContext context);

src/core/Akka.Tests/Actor/ActorProducerPipelineTests.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,20 @@ protected override bool Receive(object message)
4343

4444
internal class PlugActorA : PlugActor { }
4545
internal class PlugActorB : PlugActor { }
46-
4746
internal class GenericPlugin<T> : ActorProducerPluginBase<T> where T : PlugActor
4847
{
4948
public override void AfterIncarnated(T actor, IActorContext context)
5049
{
5150
actor.PluginMessages.Add(typeof(T).ToString());
5251
}
5352
}
54-
5553
internal class WorkingPlugin : ActorProducerPluginBase<PlugActor>
5654
{
5755
public override void AfterIncarnated(PlugActor actor, IActorContext context)
5856
{
5957
actor.PluginMessages.Add("working plugin");
6058
}
6159
}
62-
6360
internal class FailingPlugin : ActorProducerPluginBase<PlugActor>
6461
{
6562
public override void AfterIncarnated(PlugActor actor, IActorContext context)
@@ -68,7 +65,6 @@ public override void AfterIncarnated(PlugActor actor, IActorContext context)
6865
throw new TestException("plugin failed");
6966
}
7067
}
71-
7268
internal class OrderedPlugin : ActorProducerPluginBase<PlugActor>
7369
{
7470
private readonly int _index;
@@ -123,7 +119,9 @@ public StashingActor()
123119
public ActorProducerPipelineTests()
124120
{
125121
var extendedSystem = (ExtendedActorSystem)Sys;
122+
126123
_resolver = extendedSystem.ActorPipelineResolver;
124+
127125
}
128126

129127
[Fact]

src/core/Akka/Actor/ActorCell.cs

+1
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ protected virtual ActorBase CreateNewActorInstance()
355355

356356
// Apply default of custom behaviors to actor.
357357
var pipeline = _systemImpl.ActorPipelineResolver.ResolvePipeline(actor.GetType());
358+
358359
pipeline.AfterActorIncarnated(actor, this);
359360

360361
if (actor is IInitializableActor initializableActor)

src/core/Akka/Actor/ActorProducerPipeline.cs

+3-8
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace Akka.Actor
1818
/// <summary>
1919
/// Plugin interface used to define
2020
/// </summary>
21-
[Obsolete("Actor producer pipeline API will be removed in v1.5.")]
2221
public interface IActorProducerPlugin
2322
{
2423
/// <summary>
@@ -45,8 +44,7 @@ public interface IActorProducerPlugin
4544

4645
/// <summary>
4746
/// Base actor producer pipeline plugin class.
48-
/// </summary>
49-
[Obsolete("Actor producer pipeline API will be removed in v1.5.")]
47+
/// </summary>
5048
public abstract class ActorProducerPluginBase : IActorProducerPlugin
5149
{
5250
/// <summary>
@@ -76,8 +74,7 @@ public virtual void BeforeIncarnated(ActorBase actor, IActorContext context) { }
7674

7775
/// <summary>
7876
/// Base generic actor producer pipeline plugin class.
79-
/// </summary>
80-
[Obsolete("Actor producer pipeline API will be removed in v1.5.")]
77+
/// </summary>
8178
public abstract class ActorProducerPluginBase<TActor> : IActorProducerPlugin where TActor : ActorBase
8279
{
8380
/// <summary>
@@ -118,7 +115,6 @@ public virtual void BeforeIncarnated(TActor actor, IActorContext context) { }
118115
/// <summary>
119116
/// Class used to resolving actor producer pipelines depending on actor type.
120117
/// </summary>
121-
[Obsolete("Actor producer pipeline API will be removed in v1.5.")]
122118
public class ActorProducerPipelineResolver
123119
{
124120
private readonly Lazy<ILoggingAdapter> _log;
@@ -233,8 +229,7 @@ private bool AlreadyExists(IActorProducerPlugin plugin)
233229

234230
/// <summary>
235231
/// TBD
236-
/// </summary>
237-
[Obsolete("Actor producer pipeline API will be removed in v1.5.")]
232+
/// </summary>
238233
public class ActorProducerPipeline : IEnumerable<IActorProducerPlugin>
239234
{
240235
private Lazy<ILoggingAdapter> _log;

src/core/Akka/Actor/ExtendedActorSystem.cs

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public abstract class ExtendedActorSystem : ActorSystem
4343
/// Gets the actor producer pipeline resolver for current actor system. It may be used by
4444
/// Akka plugins to inject custom behavior directly into actor creation chain.
4545
/// </summary>
46-
[Obsolete("Actor producer pipeline API will be removed in v1.5.")]
4746
public abstract ActorProducerPipelineResolver ActorPipelineResolver { get; }
4847

4948
/// <summary>

src/core/Akka/Actor/Internal/ActorSystemImpl.cs

+3
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public ActorSystemImpl(
140140
public override ILoggingAdapter Log { get { return _log; } }
141141

142142
/// <inheritdoc cref="ActorSystem"/>
143+
143144
public override ActorProducerPipelineResolver ActorPipelineResolver { get { return _actorProducerPipelineResolver; } }
144145

145146
/// <inheritdoc cref="ActorSystem"/>
@@ -480,7 +481,9 @@ private void ConfigureDispatchers()
480481
private void ConfigureActorProducerPipeline()
481482
{
482483
// we push Log in lazy manner since it may not be configured at point of pipeline initialization
484+
483485
_actorProducerPipelineResolver = new ActorProducerPipelineResolver(() => Log);
486+
484487
}
485488

486489
private void ConfigureTerminationCallbacks()

0 commit comments

Comments
 (0)