pekko/akka-docs/rst/java/scala-compat.rst
Patrik Nordwall 4bd6b7aab1 improve AbstractActor, #21717
* Receive class that wraps PartialFunction, to avoid
  scary scala types
* move AbstractActorContext to AbstractActor.ActorContext
* converting docs, many, many UntypedActor
* removing UntypedActor docs
* add unit test for ReceiveBuilder
* MiMa filters
* consistent use of getContext(), self(), sender()
* rename cross references
* migration guide
* skip samples for now
* improve match type safetyi, add matchUnchecked
  * the `? extends P` caused code like this to compile:
    `match(String.class, (Integer i) -> {})`
  * added matchUnchecked, since it can still be useful (um, convenient)
    to be able to do:
    `matchUnchecked(List.class, (List<String> list) -> {})`
* eleminate some scala.Option
  * preRestart
  * findChild
  * ActorIdentity.getActorRef
2017-01-23 18:30:52 +01:00

24 lines
1 KiB
ReStructuredText

.. _scala-java-compat:
Java 8 and Scala Compatibility
==============================
Starting with Akka 2.4.2 we have begun to introduce Java 8 types (most
prominently ``java.util.concurrent.CompletionStage`` and
``java.util.Optional``) where that was possible without breaking binary or
source compatibility. Where this was not possible (for example in the return
type of ``ActorSystem.terminate()``) please refer to the
``scala-java8-compat`` library that allows easy conversion between the Scala
and Java counterparts. The artifact can be included in Maven builds using::
<dependency>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-java8-compat_2.11</artifactId>
<version>0.7.0</version>
</dependency>
We will only be able to seamlessly integrate all functional interfaces once
we can rely on Scala 2.12 to provide full interoperability—this will mean that
Scala users can directly implement Java Functional Interfaces using lambda syntax
as well as that Java users can directly implement Scala functions using lambda
syntax.