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 functionalityoutside Eclipse?

Title: Message
Kai,
you may want to check also OSCAR at objectweb http://oscar.objectweb.org/ and http://nutch.org
OSCAR is a general purpose server-or-client-side OSGI implementation, while nutch has borrowoed the idea of Eclipse plugin for server side extensibility (not osgi based AFAIK).
A nutch plugin manifest can even be managed with Eclipse own manifest editor...

--
Cheers
Philippe

philippe ombredanne | nexB - Open by Design (tm)
1 650 799 0949 | pombredanne at nexb.com
http://www.nexb.com

-----Original Message-----
From: platform-core-dev-bounces@xxxxxxxxxxx [mailto:platform-core-dev-bounces@xxxxxxxxxxx] On Behalf Of Kai Shen
Sent: Tuesday, April 12, 2005 4:17 PM
To: Eclipse Platform Core component developers list.
Cc: Kai Shen
Subject: [platform-core-dev] Can I use Eclipse Platform Core functionalityoutside Eclipse?

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
 
 


Back to the top