Adding Java docs for Serialization, and discovered some flaws with the Java API, that have been fixed

This commit is contained in:
Viktor Klang 2011-12-30 22:00:49 +01:00
parent d8b2f88ced
commit fbb7cb20a1
10 changed files with 266 additions and 57 deletions

View file

@ -73,7 +73,7 @@ class Serialization(val system: ActorSystemImpl) extends Extension {
* Returns either the resulting object or an Exception if one was thrown.
*/
def deserialize(bytes: Array[Byte],
serializerId: Serializer.Identifier,
serializerId: Int,
clazz: Option[Class[_]],
classLoader: Option[ClassLoader]): Either[Exception, AnyRef] =
try {
@ -164,9 +164,9 @@ class Serialization(val system: ActorSystemImpl) extends Extension {
lazy val serializerMap: Map[String, Serializer] = bindings mapValues serializers
/**
* Maps from a Serializer.Identifier (Byte) to a Serializer instance (optimization)
* Maps from a Serializer Identity (Int) to a Serializer instance (optimization)
*/
lazy val serializerByIdentity: Map[Serializer.Identifier, Serializer] =
lazy val serializerByIdentity: Map[Int, Serializer] =
Map(NullSerializer.identifier -> NullSerializer) ++ serializers map { case (_, v) (v.identifier, v) }
}