I want to create a Custom Remote Execution Client for my app. Customer can see something like this:
Interface Client {& lt; T & gt;
and can be used like this:
client client = new client (); Integer Remote Result = client.computeRemotely (list -> gt; {integer result = -1; // here works some computational results; return result;});
This means that I need to take the lambda from the client somehow, send it to the server, run the function (actual log into the list & lt; MyBigObject & gt; < / Code>) and send the results back.
It is worth noting that the restriction on using my client library is that you can not use anything outside JDK in that lambda and hope that this works (classes are classpath But not on the server) ... but I want them to be able to use any JDK classes to bring their data into account.
Now I just go to function < MyBigObject, T & gt;
lambda because it serializes similar to any client of the class which is present in lambda which will not be on the server on the class path.
So I see the ASM to see if it can work or not that I have not previously manipulated the byte code, I just want to see what I am saying right:
- I can use ASM to read the class that sits in Lambda.
- Using the method visitor, get method bytes, send them to the server
- Use an ASM to create an instance from the bytes and execute it.
Given that Lambda is like an anonymous insider class, I think that I will also have a way to change some names in it ..
Is it almost right Is the end of the stick or is I completely wrong?
Note that Lambda can use all the fixed values from its context. In this way, you should refuse to access external values (which will severely limit the usefulness of your solution) or identify them and send representations of those values (which runs in the problem you mentioned; The implementation server can be outside the classpath).
So if you send legal representation (for which you do not need ASM, you can get the resource directly from the Classloader), this will not work for the general case.
Edit: In view of your comment, it can work
- Reference Features as the Last Field
- Arguments for All Areas
No comments:
Post a Comment