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

Solution offering formultiple plugins JVM loading #87

Closed
skylerush opened this issue May 4, 2020 · 3 comments
Closed

Solution offering formultiple plugins JVM loading #87

skylerush opened this issue May 4, 2020 · 3 comments

Comments

@skylerush
Copy link

https://stackoverflow.com/questions/482633/in-java-is-it-possible-to-know-whether-a-class-has-already-been-loaded
I did some investigating journalism and I found that thread that can detect if the library is already loaded
and if soo use the current loading version if not load It!

@skylerush
Copy link
Author

#82

@JitseB
Copy link
Owner

JitseB commented Jun 22, 2020

Thanks! I'll look into this.

@JitseB
Copy link
Owner

JitseB commented Jun 22, 2020

So, the answer is yes and no. I could indeed use this to check if the library is loaded multiple times. Yes, this could definitely work for servers that run the library as a plugin on the server. There's only one instance of the class in this case. We just want to load another 'slave' of the same instance.

However, most developers use Maven to shade the library. This will undoubtedly cause issues like #79, which I sadly can't do anything about at the moment.

For a new major release of NPCLib, I'll have to take this into account. Either the library should be able to be ported to a new package or I should just convert it to a standalone plugin, removing this problem altogether and use the loader as described above.

For now, you can use the solution I brought up in #79.

Best of luck! (and I'll keep this in mind when redesigning the library for the next major release). 💻

@JitseB JitseB closed this as completed Jun 22, 2020
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

No branches or pull requests

2 participants