Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Start DS from command line
Start DS from command line [message #81723] Mon, 22 January 2007 15:03
Eclipse UserFriend
Originally posted by: lars.millberg.no.spam.saabgroup.no.spam.com

Hi all,

I've been playing around a little with Declarative Services, and have a
newbie question.

What's the typical process to get something to run outside of Eclipse? To
keep it simple, let's say we have a bundle (project kind "OSGi Framework ->
Equinox") with the following trivial component:

(from manifest.mf)
Require-Bundle: org.eclipse.equinox.ds,
org.eclipse.osgi.services
Service-Component: OSGI-INF/bar.xml

(osgi-inf/bar.xml)
<?xml version="1.0" encoding="UTF-8"?>
<component name="com.foo.bar">
<implementation class ="com.foo.proj.Bar"/>
</component>

(com.foo.proj.Bar.java)
package com.foo.proj;
import org.osgi.service.component.ComponentContext;
public class Bar {
protected void activate(ComponentContext ctxt) {
System.out.println("Bar opened");
}
protected void deactivate(ComponentContext ctxt) {
System.out.println("Bar closed");
}
}

If I launch it from within Eclipse (from an OSGi launch config) everything
starts nicely and it outputs "Bar opened" to the console. Stop the bundle
and it replies "Bar closed", as expected.

So, now I want to launch this from outside Eclipse. I read the Quick Start
page (http://www.eclipse.org/equinox/documents/quickstart.php) and it
mentions the config.ini file and more. After figuring out what isn't
explicitly mentioned on the page I eventually succeeded to get the bundles
installed automatically, but the text doesn't mention how to get the bundles
to start.
Since the OSGi launcher within Eclipse does this, I believe it can be done,
but how? Is there a way to see the complete command line that Eclise uses?
It might help.

An a related issue: How do you typically build a product like this?
Do you create an Eclipse feature with all the needed OSGi framework bundles
and xerces and what not, and a feature with your own stuff, and then a
product configuration with these features?
Is there a better way?

TIA for any pointers,
Lars
Previous Topic:Plugin from existing jar archive
Next Topic:Using plugins in web application context
Goto Forum:
  


Current Time: Fri Mar 29 15:17:48 GMT 2024

Powered by FUDForum. Page generated in 0.03117 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top