Merged with master
This commit is contained in:
commit
6976317bc7
35 changed files with 259 additions and 166 deletions
|
|
@ -81,7 +81,7 @@ class FSMDocSpec extends MyFavoriteTestFrameWorkPlusAkkaTestKit {
|
|||
//#unhandled-elided
|
||||
//#fsm-body
|
||||
|
||||
initialize
|
||||
initialize()
|
||||
}
|
||||
//#simple-fsm
|
||||
object DemoCode {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
package docs.serialization {
|
||||
|
||||
import org.scalatest.matchers.MustMatchers
|
||||
import akka.testkit._
|
||||
//#imports
|
||||
import akka.actor.{ ActorRef, ActorSystem }
|
||||
|
|
@ -16,7 +15,6 @@ package docs.serialization {
|
|||
import akka.actor.ExtendedActorSystem
|
||||
import akka.actor.Extension
|
||||
import akka.actor.Address
|
||||
import akka.remote.RemoteActorRefProvider
|
||||
|
||||
//#my-own-serializer
|
||||
class MyOwnSerializer extends Serializer {
|
||||
|
|
@ -164,16 +162,8 @@ package docs.serialization {
|
|||
//#actorref-serializer
|
||||
// Serialize
|
||||
// (beneath toBinary)
|
||||
val identifier: String = Serialization.serializedActorPath(theActorRef)
|
||||
|
||||
// If there is no transportAddress,
|
||||
// it means that either this Serializer isn't called
|
||||
// within a piece of code that sets it,
|
||||
// so either you need to supply your own,
|
||||
// or simply use the local path.
|
||||
val identifier: String = Serialization.currentTransportAddress.value match {
|
||||
case null ⇒ theActorRef.path.toSerializationFormat
|
||||
case address ⇒ theActorRef.path.toSerializationFormatWithAddress(address)
|
||||
}
|
||||
// Then just serialize the identifier however you like
|
||||
|
||||
// Deserialize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue