Home » Eclipse Projects » Equinox » Using Extension Registry without OSGi
Using Extension Registry without OSGi [message #95291] |
Mon, 20 August 2007 14:52 |
Eclipse User |
|
|
|
Originally posted by: kaputin.uk.ibm.com
I'm looking at using the Eclipse Extension Registry within my application to
configure extensions, but I'd like to use it 'stand alone' - independently
of OSGi and the Eclipse Platform. I have a question about a dependency on an
OSGi jar file.
I have some code that instantiates an IExtensionRegistry via RegistryFactory
and calls IExtensionRegistry.addContribution to load my plugin.xml. This
code works, but it requires the following jar files on the classpath:
* org.eclipse.equinox.common_3.2.0.v20060603.jar
* org.eclipse.equinox.registry_3.2.1.R32x_v20060814.jar
* org.eclipse.osgi_3.2.1.R32x_v20060919.jar
The two equinox jars are fine. The osgi jar is required for the NLS.class
file loaded by the addContribution method. If I remove this jar from the
classpath I get an exception:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/eclipse/osgi/util/NLS
The osgi jar is large (830K) compared to the equinonx jars (78K and 141K).
Is there any way I can avoid this dependency on the osgi jar? Perhaps there
is a different programming model I should be using?
Here's the relevant fragment from my code:
RegistryStrategy s = new RegistryStrategy(null, null);
IExtensionRegistry registry = RegistryFactory.createRegistry(s,
null, null);
InputStream is;
try {
is = new
FileInputStream(" C:\\workspace\\woden\\jktest\\src\\org\\apache\\woden\\inter nal\\wsdl20\\extensions\\plugin.xml ");
} catch (FileNotFoundException e) {
System.out.println(" plugin.xml can not be found.");
return;
}
IContributor c = new RegistryContributor("1","org.apache.woden",
null, null);
if (registry.addContribution(is, c, false, null, null, null)) {
System.out.println(" plugin added");
}
...
thanks,
John Kaputin.
|
|
|
Re: Using Extension Registry without OSGi [message #95455 is a reply to message #95291] |
Mon, 20 August 2007 21:19 |
Eclipse User |
|
|
|
Originally posted by: alex_blewitt.yahoo.com
Not really. You could look at other OSGi engines (e.g. www.knopflerfish.org, felix.apache.org) which have a smaller OSGi engine point.
One of the reasons why the extension registry is small is because it depends on code in the OSGi bundle :-)
Alex.
|
|
|
Re: Using Extension Registry without OSGi [message #95493 is a reply to message #95291] |
Tue, 21 August 2007 09:46 |
Danail Nachev Messages: 36 Registered: July 2009 |
Member |
|
|
Hi,
You need to get hold of org.eclipse.equinox.supplement bundle:
http://www.eclipse.org/equinox/bundles/
This will enable you to use the Registry outside of OSGi or on another
OSGi implementation.
new.eclipse.org wrote:
> I'm looking at using the Eclipse Extension Registry within my application to
> configure extensions, but I'd like to use it 'stand alone' - independently
> of OSGi and the Eclipse Platform. I have a question about a dependency on an
> OSGi jar file.
>
> I have some code that instantiates an IExtensionRegistry via RegistryFactory
> and calls IExtensionRegistry.addContribution to load my plugin.xml. This
> code works, but it requires the following jar files on the classpath:
> * org.eclipse.equinox.common_3.2.0.v20060603.jar
> * org.eclipse.equinox.registry_3.2.1.R32x_v20060814.jar
> * org.eclipse.osgi_3.2.1.R32x_v20060919.jar
>
> The two equinox jars are fine. The osgi jar is required for the NLS.class
> file loaded by the addContribution method. If I remove this jar from the
> classpath I get an exception:
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/eclipse/osgi/util/NLS
>
> The osgi jar is large (830K) compared to the equinonx jars (78K and 141K).
> Is there any way I can avoid this dependency on the osgi jar? Perhaps there
> is a different programming model I should be using?
>
> Here's the relevant fragment from my code:
> RegistryStrategy s = new RegistryStrategy(null, null);
> IExtensionRegistry registry = RegistryFactory.createRegistry(s,
> null, null);
>
> InputStream is;
> try {
> is = new
> FileInputStream(" C:\\workspace\\woden\\jktest\\src\\org\\apache\\woden\\inter nal\\wsdl20\\extensions\\plugin.xml ");
> } catch (FileNotFoundException e) {
> System.out.println(" plugin.xml can not be found.");
> return;
> }
>
> IContributor c = new RegistryContributor("1","org.apache.woden",
> null, null);
>
> if (registry.addContribution(is, c, false, null, null, null)) {
> System.out.println(" plugin added");
> }
> ...
>
>
> thanks,
>
> John Kaputin.
>
>
|
|
|
Re: Using Extension Registry without OSGi [message #95849 is a reply to message #95493] |
Fri, 24 August 2007 13:26 |
Oleg Besedin Messages: 41 Registered: July 2009 |
Member |
|
|
Hi,
Danail is 100% correct, the additional code is located in the
org.eclipse.equinox.supplement bundle. There is a code in the equinox
incubator that does this for testing purposes:
http://wiki.eclipse.org/Equinox_Testing_-_3.3#Part_IV._Stand alone_registry_run
The test plugin org.eclipse.equinox.test.standalone checks standalone
(non-OSGi) registry and can be found in the CVS
:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
under equinox-incubator/tests.
Sincerely,
Oleg Besedin
"Danail Nachev" <d_nachev@prosyst.bg> wrote in message
news:faecaf$phr$1@build.eclipse.org...
> Hi,
>
> You need to get hold of org.eclipse.equinox.supplement bundle:
>
> http://www.eclipse.org/equinox/bundles/
>
> This will enable you to use the Registry outside of OSGi or on another
> OSGi implementation.
>
> new.eclipse.org wrote:
>> I'm looking at using the Eclipse Extension Registry within my application
>> to
>> configure extensions, but I'd like to use it 'stand alone' -
>> independently
>> of OSGi and the Eclipse Platform. I have a question about a dependency on
>> an
>> OSGi jar file.
>>
>> I have some code that instantiates an IExtensionRegistry via
>> RegistryFactory
>> and calls IExtensionRegistry.addContribution to load my plugin.xml. This
>> code works, but it requires the following jar files on the classpath:
>> * org.eclipse.equinox.common_3.2.0.v20060603.jar
>> * org.eclipse.equinox.registry_3.2.1.R32x_v20060814.jar
>> * org.eclipse.osgi_3.2.1.R32x_v20060919.jar
>>
>> The two equinox jars are fine. The osgi jar is required for the NLS.class
>> file loaded by the addContribution method. If I remove this jar from the
>> classpath I get an exception:
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/eclipse/osgi/util/NLS
>>
>> The osgi jar is large (830K) compared to the equinonx jars (78K and
>> 141K).
>> Is there any way I can avoid this dependency on the osgi jar? Perhaps
>> there
>> is a different programming model I should be using?
>>
>> Here's the relevant fragment from my code:
>> RegistryStrategy s = new RegistryStrategy(null, null);
>> IExtensionRegistry registry = RegistryFactory.createRegistry(s,
>> null, null);
>>
>> InputStream is;
>> try {
>> is = new
>> FileInputStream(" C:\\workspace\\woden\\jktest\\src\\org\\apache\\woden\\inter nal\\wsdl20\\extensions\\plugin.xml ");
>> } catch (FileNotFoundException e) {
>> System.out.println(" plugin.xml can not be found.");
>> return;
>> }
>>
>> IContributor c = new RegistryContributor("1","org.apache.woden",
>> null, null);
>>
>> if (registry.addContribution(is, c, false, null, null, null)) {
>> System.out.println(" plugin added");
>> }
>> ...
>>
>>
>> thanks,
>>
>> John Kaputin.
>>
>>
|
|
|
Goto Forum:
Current Time: Sat Apr 27 02:04:36 GMT 2024
Powered by FUDForum. Page generated in 0.03462 seconds
|