make everything except tutorial-second compile
someone should look at remoting vs. timeout (i.e. which is sent around), because I removed that in some places. It might simply be irrelevant once we remove the Future special-casing.
This commit is contained in:
parent
93b1ef3703
commit
14751f7d29
22 changed files with 300 additions and 254 deletions
|
|
@ -6,20 +6,20 @@ package akka.remote
|
|||
|
||||
import akka.remote.RemoteProtocol._
|
||||
import akka.serialization.Serialization
|
||||
|
||||
import com.google.protobuf.ByteString
|
||||
import akka.AkkaApplication
|
||||
|
||||
object MessageSerializer {
|
||||
|
||||
def deserialize(messageProtocol: MessageProtocol, classLoader: Option[ClassLoader] = None): AnyRef = {
|
||||
def deserialize(app: AkkaApplication, messageProtocol: MessageProtocol, classLoader: Option[ClassLoader] = None): AnyRef = {
|
||||
val clazz = loadManifest(classLoader, messageProtocol)
|
||||
Serialization.deserialize(messageProtocol.getMessage.toByteArray,
|
||||
app.serialization.deserialize(messageProtocol.getMessage.toByteArray,
|
||||
clazz, classLoader).fold(x ⇒ throw x, o ⇒ o)
|
||||
}
|
||||
|
||||
def serialize(message: AnyRef): MessageProtocol = {
|
||||
def serialize(app: AkkaApplication, message: AnyRef): MessageProtocol = {
|
||||
val builder = MessageProtocol.newBuilder
|
||||
val bytes = Serialization.serialize(message).fold(x ⇒ throw x, b ⇒ b)
|
||||
val bytes = app.serialization.serialize(message).fold(x ⇒ throw x, b ⇒ b)
|
||||
builder.setMessage(ByteString.copyFrom(bytes))
|
||||
builder.setMessageManifest(ByteString.copyFromUtf8(message.getClass.getName))
|
||||
builder.build
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue