Quick background: I am working on developing an interface that will be implemented by myself and other developers. This interface will allow users to "plugin" new functional code into a system for new use. This new code will be called from an already running server/application. (TLDR: I need to develop the ability for plugins to be installed into my application on the fly)
All the work I have done with interfaces so far have been for internal coding purposes, not to be exposed outward. The only way I can think of to allow users to plugin new code implementing interfaces, would be for the user to somehow hook a JAR file in containing the implementing class and somehow defining its class signature for call. This seems like something that has been done before, I just have never been exposed into the coding side of it.
Is there a framework I could use to allow this plugin of new Java code during server/application runtime? I have used APIs before, but in more of the web service exposing sense where you are consuming a service and not "implementing" some core interface.
For reference I am using a Java backend, with Spring for the main application.