From 0e75c68a2c9f4bfe2ed10ce6ba02addfe28a9f30 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Sat, 25 Feb 2023 00:44:23 +0700 Subject: [PATCH] Remove TypedActor (#6437) * Remove TypedActor * Update API Verify --- .../CoreAPISpec.ApproveCore.Core.verified.txt | 10 ---- ...oreAPISpec.ApproveCore.DotNet.verified.txt | 10 ---- .../CoreAPISpec.ApproveCore.Net.verified.txt | 10 ---- src/core/Akka/Actor/TypedActor.cs | 50 ------------------- 4 files changed, 80 deletions(-) delete mode 100644 src/core/Akka/Actor/TypedActor.cs diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Core.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Core.verified.txt index 4d81f52772a..f47c86ba2e1 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Core.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Core.verified.txt @@ -1080,10 +1080,6 @@ namespace Akka.Actor T CreateExtension(Akka.Actor.ExtendedActorSystem system); T Get(Akka.Actor.ActorSystem system); } - public interface IHandle - { - void Handle(TMessage message); - } public interface IInboxable : Akka.Actor.ICanWatch { Akka.Actor.IActorRef Receiver { get; } @@ -1823,12 +1819,6 @@ namespace Akka.Actor public TerminatedProps() { } public override Akka.Actor.ActorBase NewActor() { } } - [System.ObsoleteAttribute("TypedActor in its current shape will be removed in v1.5")] - public abstract class TypedActor : Akka.Actor.ActorBase - { - protected TypedActor() { } - protected virtual bool Receive(object message) { } - } [Akka.Annotations.InternalApiAttribute()] public class UnstartedCell : Akka.Actor.ICell { diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.DotNet.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.DotNet.verified.txt index b454963884f..43f61f67238 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.DotNet.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.DotNet.verified.txt @@ -1082,10 +1082,6 @@ namespace Akka.Actor T CreateExtension(Akka.Actor.ExtendedActorSystem system); T Get(Akka.Actor.ActorSystem system); } - public interface IHandle - { - void Handle(TMessage message); - } public interface IInboxable : Akka.Actor.ICanWatch { Akka.Actor.IActorRef Receiver { get; } @@ -1825,12 +1821,6 @@ namespace Akka.Actor public TerminatedProps() { } public override Akka.Actor.ActorBase NewActor() { } } - [System.ObsoleteAttribute("TypedActor in its current shape will be removed in v1.5")] - public abstract class TypedActor : Akka.Actor.ActorBase - { - protected TypedActor() { } - protected virtual bool Receive(object message) { } - } [Akka.Annotations.InternalApiAttribute()] public class UnstartedCell : Akka.Actor.ICell { diff --git a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Net.verified.txt b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Net.verified.txt index 4d81f52772a..f47c86ba2e1 100644 --- a/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Net.verified.txt +++ b/src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Net.verified.txt @@ -1080,10 +1080,6 @@ namespace Akka.Actor T CreateExtension(Akka.Actor.ExtendedActorSystem system); T Get(Akka.Actor.ActorSystem system); } - public interface IHandle - { - void Handle(TMessage message); - } public interface IInboxable : Akka.Actor.ICanWatch { Akka.Actor.IActorRef Receiver { get; } @@ -1823,12 +1819,6 @@ namespace Akka.Actor public TerminatedProps() { } public override Akka.Actor.ActorBase NewActor() { } } - [System.ObsoleteAttribute("TypedActor in its current shape will be removed in v1.5")] - public abstract class TypedActor : Akka.Actor.ActorBase - { - protected TypedActor() { } - protected virtual bool Receive(object message) { } - } [Akka.Annotations.InternalApiAttribute()] public class UnstartedCell : Akka.Actor.ICell { diff --git a/src/core/Akka/Actor/TypedActor.cs b/src/core/Akka/Actor/TypedActor.cs deleted file mode 100644 index 577ea1a337f..00000000000 --- a/src/core/Akka/Actor/TypedActor.cs +++ /dev/null @@ -1,50 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (C) 2009-2022 Lightbend Inc. -// Copyright (C) 2013-2022 .NET Foundation -// -//----------------------------------------------------------------------- - -using System; -using System.Reflection; - -namespace Akka.Actor -{ - /// - /// Interface IHandle - /// - /// The type of the t message. - public interface IHandle - { - /// - /// Handles the specified message. - /// - /// The message. - void Handle(TMessage message); - } - - /// - /// Class TypedActor. - /// - [Obsolete("TypedActor in its current shape will be removed in v1.5")] - public abstract class TypedActor : ActorBase - { - /// - /// Processor for user defined messages. - /// - /// The message. - /// TBD - protected sealed override bool Receive(object message) - { - MethodInfo method = GetType().GetMethod("Handle", new[] {message.GetType()}); - if (method == null) - { - return false; - } - - method.Invoke(this, new[] {message}); - return true; - } - } -} -