= #17342 Make 2.4 binary compatible with 2.3

(cherry picked from commit 89af8bdb90)

* remove final identifier in serializers

i* revert/deprecate ProtobufSerializer.ARRAY_OF_BYTE_ARRAY

* adding back compatible empty constructor in serializers

* make FSM.State compatible

* add back ActorPath.ElementRegex

* revert SocketOption changes and add SocketOptionV2
  see a6d3704ef6

* problem filter for ActorSystem and ActorPath

* problem filter for ByteString

* problem filter for deprecated Timeout methods

* BalancingPool companion

* ask

* problem filter for ActorDSL

* event bus

* exclude hasSubscriptions

* exclude some problems in testkit

* boundAddress and addressFromSocketAddress

* Pool nrOfInstances

* PromiseActorRef

* check with 2.3.9

* migration guide note

* explicit exclude of final class problems
This commit is contained in:
Patrik Nordwall 2015-04-30 09:23:18 +02:00
parent 412491d277
commit b30e460be7
50 changed files with 1037 additions and 202 deletions

View file

@ -39,7 +39,7 @@ import akka.event.japi.ScanningEventBus;
//#scanning-bus
//#actor-bus
import akka.event.japi.ActorEventBus;
import akka.event.japi.ManagedActorEventBus;
//#actor-bus
@ -232,7 +232,7 @@ public class EventBusDocTest {
static
//#actor-bus
public class ActorBusImpl extends ActorEventBus<Notification> {
public class ActorBusImpl extends ManagedActorEventBus<Notification> {
// the ActorSystem will be used for book-keeping operations, such as subscribers terminating
public ActorBusImpl(ActorSystem system) {
@ -304,7 +304,7 @@ public class EventBusDocTest {
}
@Test
public void demonstrateActorClassification() {
public void demonstrateManagedActorClassification() {
//#actor-bus-test
ActorRef observer1 = new JavaTestKit(system).getRef();
ActorRef observer2 = new JavaTestKit(system).getRef();

View file

@ -115,7 +115,7 @@ type :class:`ActorRef`.
This classification requires an :class:`ActorSystem` in order to perform book-keeping
operations related to the subscribers being Actors, which can terminate without first
unsubscribing from the EventBus. ActorClassification maitains a system Actor which
unsubscribing from the EventBus. ManagedActorClassification maitains a system Actor which
takes care of unsubscribing terminated actors automatically.
The necessary methods to be implemented are illustrated with the following example:

View file

@ -11,6 +11,19 @@ When migrating from earlier versions you should first follow the instructions fo
migrating :ref:`1.3.x to 2.0.x <migration-2.0>` and then :ref:`2.0.x to 2.1.x <migration-2.1>`
and then :ref:`2.1.x to 2.2.x <migration-2.2>` and then :ref:`2.2.x to 2.3.x <migration-2.3>`.
Binary Compatibility
====================
Akka 2.4.x is backwards binary compatible with previous 2.3.x versions apart from the following
exceptions. This means that the new JARs are a drop-in replacement for the old one
(but not the other way around) as long as your build does not enable the inliner (Scala-only restriction).
The following parts are not binary compatible with 2.3.x:
* akka-testkit and akka-remote-testkit
* experimental modules, such as akka-persistence and akka-contrib
* features, classes, methods that were deprecated in 2.3.x and removed in 2.4.x
Advanced Notice: TypedActors will go away
========================================
@ -31,13 +44,14 @@ In earlier versions of Akka `TestKit.remaining` returned the default timeout con
AssertionError if called outside of within. The old behavior however can still be achieved by
calling `TestKit.remainingOrDefault` instead.
EventStream and ActorClassification EventBus now require an ActorSystem
=======================================================================
EventStream and ManagedActorClassification EventBus now require an ActorSystem
==============================================================================
Both the ``EventStream`` (:ref:`Scala <event-stream-scala>`, :ref:`Java <event-stream-java>`) and the
``ActorClassification`` Event Bus (:ref:`Scala <actor-classification-scala>`, :ref:`Java <actor-classification-java>`) now
``ManagedActorClassification``, ``ManagedActorEventBus`` (:ref:`Scala <actor-classification-scala>`, :ref:`Java <actor-classification-java>`) now
require an ``ActorSystem`` to properly operate. The reason for that is moving away from stateful internal lifecycle checks
to a fully reactive model for unsubscribing actors that have ``Terminated``.
to a fully reactive model for unsubscribing actors that have ``Terminated``. Therefore the ``ActorClassification``
and ``ActorEventBus`` was deprecated and replaced by ``ManagedActorClassification`` and ``ManagedActorEventBus``
If you have implemented a custom event bus, you will need to pass in the actor system through the constructor now:
@ -63,25 +77,6 @@ Which turns out to be useful in many systems where same-state transitions actual
In case you do *not* want to trigger a state transition event when effectively performing an ``X->X`` transition, use ``stay()`` instead.
More control over Channel properties in Akka-IO
===============================================
Method signatures for ``SocketOption`` have been changed to take a channel instead of a socket. The channel's socket
can be retrieved by calling ``channel.socket``. This allows for accessing new NIO features in Java 7.
======================================== =====================================
2.3 2.4
======================================== =====================================
``beforeDatagramBind(DatagramSocket)`` ``beforeBind(DatagramChannel)``
``beforeServerSocketBind(ServerSocket)`` ``beforeBind(ServerSocketChannel)``
``beforeConnect(Socket)`` ``beforeBind(SocketChannel)``
\ ``afterConnect(DatagramChannel)``
\ ``afterConnect(ServerSocketChannel)``
``afterConnect(Socket)`` ``afterConnect(SocketChannel)``
======================================== =====================================
A new class ``DatagramChannelCreator`` which extends ``SocketOption`` has been added. ``DatagramChannelCreator`` can be used for
custom ``DatagramChannel`` creation logic. This allows for opening IPv6 multicast datagram channels.
Cluster Sharding Entry Path Change
==================================
Previously in ``2.3.x`` entries were direct children of the local ``ShardRegion``. In examples the ``persistenceId`` of entries

View file

@ -121,12 +121,12 @@ object EventBusDocSpec {
//#actor-bus
import akka.event.ActorEventBus
import akka.event.ActorClassification
import akka.event.ManagedActorClassification
import akka.event.ActorClassifier
final case class Notification(ref: ActorRef, id: Int)
class ActorBusImpl(val system: ActorSystem) extends ActorEventBus with ActorClassifier with ActorClassification {
class ActorBusImpl(val system: ActorSystem) extends ActorEventBus with ActorClassifier with ManagedActorClassification {
type Event = Notification
// is used for extracting the classifier from the incoming events
@ -179,7 +179,7 @@ class EventBusDocSpec extends AkkaSpec {
//#scanning-bus-test
}
"demonstrate ActorClassification" in {
"demonstrate ManagedActorClassification" in {
//#actor-bus-test
val observer1 = TestProbe().ref
val observer2 = TestProbe().ref

View file

@ -115,7 +115,7 @@ type :class:`ActorRef`.
This classification requires an :class:`ActorSystem` in order to perform book-keeping
operations related to the subscribers being Actors, which can terminate without first
unsubscribing from the EventBus. ActorClassification maitains a system Actor which
unsubscribing from the EventBus. ManagedActorClassification maitains a system Actor which
takes care of unsubscribing terminated actors automatically.
The necessary methods to be implemented are illustrated with the following example: