Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Move LiveConnect / Java interop classes to own jar #1655

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

rPraml
Copy link
Contributor

@rPraml rPraml commented Sep 26, 2024

Hello, I want to discuss, if it is a good or bad idea, to move the LiveConnect classes (NativeJavaXXX etc.) to a own package, so that it may be separated to a own jar( rhino-liveconnect.jar)

I'm aware that this requires to modify some APIs and will introduce a breaking change.

So far I have started to do a proof of concept, but before I put more energy into it, I wanted to ask if this is even desired.

The advantage is clearly, that the whole liveconnect thing, which most of the reflection and everything sits in an own jar. If the jar is not on the classpath, you cannot interact with java classes from your script.

The idea is to route everything over the wrapFactory (no wrapFactory = no liveConnect)

This PR shows the proof of concept and is still a draft. You may also see, that a lot of methods from ScriptRuntime etc. has to be made public. So I do not know if this is intended, but maybe we can adapt some of the ideas (especially, the idea, when the wrapFactory is null, that every attempt will fail in an exception)

@p-bakker
Copy link
Collaborator

I assume you know you can run Rhino without Java Interop enabled, no?

@gbrail
Copy link
Collaborator

gbrail commented Sep 26, 2024 via email

@rPraml
Copy link
Contributor Author

rPraml commented Sep 26, 2024

further input follows. Can someone change this PR to draft? I do not have the permission (or do not find the "convert to draft" button 😆 )

@rbri rbri marked this pull request as draft September 26, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants