Lambdas and serialization

Nathan Bryant nathan.bryant at
Tue Oct 19 16:13:33 PDT 2010

Take the example of an RMI client/server, where the client wants to pass
a lambda to the server for remote execution.

Although there's the general problem with anonymity of inner classes,
and non-durability of the automatically generated version ID, it's quite
sufficient (and easy) for this use case to simply ensure that the server
does not have the same class by the same name. Then it can load it via
the java.rmi.server.RMIClassLoader.

-----Original Message-----

If you want, you can; serialization is flexible enough to allow it.
Provided of course that both sides of the communication have loaded
the same class with the same name.

More information about the lambda-dev mailing list