为闭源 Netbeans 平台应用程序编写第 3 方插件
我创建了一个 Netbeans 平台应用程序并部署了它(创建了安装程序/zip 包等)。我还通过在应用程序中创建接口模块来提供扩展点(这是正确的方法吗?)。
现在我的问题是,如何编写模块来扩展此应用程序,而不必依赖于应用程序的源。例如,我想编写一个实现其中一个接口的模块。如何创建一个新的模块项目来执行此操作,以及如何让平台应用程序包含/查找这个新模块。
我正在尝试使用 Netbeans 平台应用程序架构编写 RCP 应用程序。我希望能够使其可扩展(通过接口),而不必向第三方开发人员公开源代码。我确实打算发布源代码,但从设计的角度来看,我希望它具有足够的功能,以便人们不需要拥有源代码来为应用程序编写插件。
I have created a Netbeans Platform Application and deployed it (created installer / zip bundle etc.). I have also made provision for extension points by creating Interface modules in the application (is this the correct way?).
Now my question is, how do I write modules to extend this application, without having to depend on the source of the application. For example, I want to write a module that implements one of the interfaces. How do I create a new module project that does this, and how do I get the Platform Application to include / find this new module.
I am trying to write an RCP application using the Netbeans Platform Application architecture. I want to be able to make it extendible (via interfaces) WITHOUT having to expose the source to 3rd party developers. I do intend to publish the source, but from a design perspective I want it to be functional enough that people don't need to have the source to write plugins for the application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了怎么做。您可以使用普通的 Java 服务发现方法来完成此操作。在 META-INF/services/ 下添加一个与您正在实现的接口同名的文件,并在文件中放入类的名称。两者都必须是类的完全限定名称。
Found out how to do it. You can do it with the normal Java service discovery methods. Add a file under META-INF/services/ with the same name as the interface you are implementing, and in the file put the name of the class. Both have to be the FULLY QUALIFIED name of the class.