Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-core-dev] Can I use Eclipse Platform Core functionality outside Eclipse?

Allowing users to install arbitrary plugins on your server is asking for trouble. There are no restrictions on what plugins can do. For a server addon you would want some sort of sandbox to run extensions in; Eclipse has no such feature.

Bob Foster

Kai Shen wrote:
Hi,
We're working on a server side project. In this project, we'd like to provide user an extension framework so that user can use Eclipse's extension mechanism in server side. Our goal is to allow user to develop their plug-ins in Eclipse environment and use those plug-ins directly in server side without any modification. I understand Eclipse use /org.eclipse.osgi/ and /org.eclipse.core.runtime/ to manage the bundles, classloaders and extension registry, etc. So, ideally, we can use /org.eclipse.osgi/ and /org.eclipse.core.runtime/ in our java application. However, I found the following in the Eclipse on-line help: /The Eclipse Platform makes heavy use of Java class loaders for loading plug-ins. Even the Eclipse Runtime itself and the OSGi framework need to be loaded by special class loaders. Client programs, such as a Java main program or a servlet, cannot directly reference any part of Eclipse directly. Instead, a client must use the EclipseStarter class in org.eclipse.core.runtime.adaptor to start the platform, invoking functionality defined in plug-ins, and shutting down the platform when done. / /Clients that do not need to access any particular function, but just need to start the platform, can use Main.run() in startup.jar. However, clients that need to invoke specific function should use EclipseStarter. See the javadoc inside this class for details./ It looks like we can NOT use /org.eclipse.osgi/ and /org.eclipse.core.runtime/ directly. We need to start the platform by calling EclipseStarter. The EclipseStarter will use another classloader to load the Eclipse Platform. So, I think our solution could be as follow: 1. In the java application, use EclipseStarter to start Eclipse Platform. 2. Configure the Eclipse Platform so that workbench and other UI related plug-ins won't be loaded. (Actually, only /org.eclipse.osgi/ and /org.eclipse.core.runtime/ are needed). 3. If the Java application needs to use the Eclipse core functionality (e.g. Platform.getBundle(symbolicName), platform.getExtensionRegistry(), etc.), we need to use the classloader's functions to find the class instance and then call the function in the class instance. Is this solution feasible? Did anyone do it before? I think the extension framework is a very nice feature of Eclipse. If we can use it in server applications, it will make Eclipse core even greater! Since I'm new to Eclipse Platform Core, this idea might be unrealistic. But anyway, I just want to start the discussion, because I think the goal is great, it will make Eclipse Platform more popular and benefit other developers. Your thoughts and comments are highly welcome! Thanks,
Kai

------------------------------------------------------------------------

_______________________________________________
platform-core-dev mailing list
platform-core-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-core-dev




Back to the top