Actually Lambda serialization is a good effort, I think we can leverage it by removing the dependency on the enclosing class, but only for short lived objects intended as arguments for remote objects.
ASM could be used to capture invokedynamic instructions used by the jvm to create lambdas, this could then be marshalled along with any parameters used to recreate the lambda remotely with ASM's assistance. A new class object can be created using a hash class name derived from the original instructions for the sole purpose of holding the lambda instructions (purpose is similar to the original encapsulating class) and only containing instructions necessary for lambda bytecode generation. So if a client has numerous uses of lambda's throughout it's calling class, a separate holding class would be created remotely for each lambda block. This would only occur when a functional interface extends DistributedLambda. Regards, Peter. ----- Original message ----- > To enable remote clients to invoke processing at the server with lambda > expression invocation on remote objects, without code downloads. > > Presently the enclosing class is serialized along with the lambda, > because it contains the receipe generated by the static compiler. I'm > investigating if it's possible to send only the receipe along with any > parameter objects, for dynamic code generatation at the server. > > I want to completely avoid code downloading, lambda's could potentially > allow significant performance and latency benefits by filtering and > processing at the server, prior to returning results to clients. > > Cheers, > > Peter. > > > On 9/03/2014 6:02 PM, Michał Kłeczek wrote: > > Peter, > > > > I'm still trying to grasp what you want to achieve... > > > > Is it simply in-band code downloading? > > > > Regards, > > >