Binary compat work for Akka Remote
This commit is contained in:
parent
568c02d158
commit
6bed19c6c9
10 changed files with 219 additions and 177 deletions
|
|
@ -9,8 +9,14 @@ import com.google.protobuf.ByteString
|
|||
import akka.actor.ExtendedActorSystem
|
||||
import akka.serialization.SerializationExtension
|
||||
|
||||
object MessageSerializer {
|
||||
/**
|
||||
* MessageSerializer is a helper for serialize and deserialize messages
|
||||
*/
|
||||
private[akka] object MessageSerializer {
|
||||
|
||||
/**
|
||||
* Uses Akka Serialization for the specified ActorSystem to transform the given MessageProtocol to a message
|
||||
*/
|
||||
def deserialize(system: ExtendedActorSystem, messageProtocol: MessageProtocol): AnyRef = {
|
||||
val clazz =
|
||||
if (messageProtocol.hasMessageManifest) {
|
||||
|
|
@ -24,6 +30,9 @@ object MessageSerializer {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses Akka Serialization for the specified ActorSystem to transform the given message to a MessageProtocol
|
||||
*/
|
||||
def serialize(system: ExtendedActorSystem, message: AnyRef): MessageProtocol = {
|
||||
val s = SerializationExtension(system)
|
||||
val serializer = s.findSerializerFor(message)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue