RFR: 8353487: JShell LocalExecutionControl should allow decorating the execution task
Jan Lahoda
jlahoda at openjdk.org
Fri Apr 4 15:56:51 UTC 2025
On Wed, 2 Apr 2025 23:26:05 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:
> This PR adds the ability for subclasses of JShell's `LocalExecutionControl` to configure thread-local context in the execution thread that snippets execute in. Please see [JDK-8353487](https://bugs.openjdk.org/browse/JDK-8353487) for more details & rationale.
I wonder how generic are the snippets used - for some types of snippets, it might be possible to put some code around the original snippet directly in the snippet. That would alleviate the need to add a new API. But presumably it would only work for some types of snippets.
For the API itself - just an idea, would having a method `doInvoke` along these lines work:
public Object doInvoke(Method m) throws Exception {
return doitMethod.invoke(null, new Object[0]);
}
?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24398#issuecomment-2779161950
More information about the kulla-dev
mailing list