简体   繁体   English

限制插件中的某些Java代码

[英]Restrict Certain Java Code in a Plug-in

I am creating an application which uses the Java Plugin Framework to load plug-ins and integrate them into the program. 我正在创建一个使用Java Plugin Framework加载插件并将其集成到程序中的应用程序。

My question is: Is there any way to restrict certain operations (such as starting a new process) in the plug-ins? 我的问题是:有什么方法可以限制插件中的某些操作(例如启动新进程)? What I have in mind is something like Java WebStart, ie when the application wants to access the FileSytem, the user is prompted whether or not to allow the action. 我想到的是类似Java WebStart的东西,即当应用程序要访问FileSytem时,系统会提示用户是否允许该操作。

I was thinking of maybe creating a security manager and, if so, how can I do that? 我当时正在考虑创建一个安全管理器,如果可以的话,我该怎么做?

One question comes to my mind - why did you choose JPF and not Equinox? 我想到一个问题-为什么选择JPF而不选择Equinox? I was curious and looked at the JPF pages and it looks like the projects last update is two years ago. 我很好奇,看着JPF页面,看起来项目的最新更新是两年前。

They started the project to decouple the eclipse plugin framework of Eclipse 2.x but Eclipse itself moved to OSGi (Equinox) starting with version 3.0. 他们开始了该项目,以解耦Eclipse 2.x的eclipse插件框架,但是Eclipse本身从3.0版开始迁移到OSGi(Equinox)。 Equinox has become the reference implementation of OSGi and there's a lot of good books available and even more excellent experts that can provide help on any aspect. Equinox已成为OSGi的参考实现,并且有很多不错的书籍,甚至还有更出色的专家都可以在任何方面提供帮助。

To my opinion: JPF was a good idea some years ago (just as the first implementations of a plug-in framework in early Eclipse releases) but the actual standard for a plug-in framework seems to be OSGi now. 我认为:几年前,JPF是个好主意(就像Eclipse早期版本中的第一个插件框架实现一样),但是插件框架的实际标准现在似乎是OSGi。

Sure, that does not answer your question, but my message was just to long for a comment. 当然,这并不能回答您的问题,但是我的留言很久没发表评论了。

Here's a site that explains implementing security with Equinox (or at least gives some hints): http://www.eclipse.org/equinox/security/ 这是一个解释如何使用Equinox实现安全性的网站(或至少提供了一些提示): http : //www.eclipse.org/equinox/security/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM