How to create a pluginable Java program?

后端 未结 6 1834
粉色の甜心
粉色の甜心 2020-12-12 13:48

I want to create a Java program that can be extended with plugins. How can I do that and where should I look for?

I have a set of interfaces that the plugin must imp

6条回答
  •  渐次进展
    2020-12-12 14:34

    I recommend that you take a close look at the Java Service Provider (SPI) API. It provides a simple system for finding all of the classes in all Jars on the classpath that expose themselves as implementing a particular service. I've used it in the past with plugin systems with great success.

提交回复
热议问题