I have a java desktop application and I want to add plugin/addons support feature to my app
After search I see Blender3D addons is very nice just copy some file to Blender directory and enable it on preferences window then that addons can add new engine, menu, button and panel and ..... I like this style and want to have something like this in my app to develop it just with plugin after release the main application
I find OSGi but can't understand how to use the plugin created with this feature in my main app?! and also I don't want to use Eclipse RCP or Netbeans RCP, I want to add this feature to my current main application that use javafx for gui.
thanks,
take a look at the java reflection api
java.lang.reflect.Method, etc.
also learn what purpose interfaces and abstract classes serve. you will probably want to have your plugin api supply one or more interfaces with one or more abstract classes to serve as concrete base classes for implementations to extend.
a good example in the actual jdk is the jdbc api. it is completely plugin driven (you ask the DriverManager to instantiate a driver for a given URI, and it handles marshalling the implementation, which is hidden behind interfaces and abstract classes).
cheers