[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Re: Embedding Equinox OSGi and EclipseStarter

Oleg Besedin <obesedin@xxxxxxxxxx> writes:

> In short, it seems that there is no easy way to establish
> communication between a Java application and Eclipse instance
> launched from it.

On a related note, I've been struggling with porting my own
framework-launching application from Felix to Equinox, due to the
following feature present in the former and missing in the latter.

In Felix, one can provide a list of BundleActivator instances to the
framework's startup function (Felix.start()). These BundleActivators
enable an easy way to hook in some "thin" or "virtual" bundles without
actually calving off and packaging this code as an actual bundle.

Motivating example: I wrote a framework event monitor that listens to
events and posts progress messages to a splash screen. The splash
screen is presented by the main launching application immediately upon
startup. This application creates a framework event monitor with a
reference to the splash screen, and supplies the framework with the
monitor as part of the initial set of BundleActivators. These
BundleActivators get called upon /first/ as part of the SystemBundle's
startup process.

What's important here is that code running in the context of the OSGi
framework (with access to a BundleContext) can hold a reference to and
interact with object instances created /outside/ the framework. It
allows some straddling the line between what's inside and outside.

I don't see any equivalent mechanism in the Equinox boot
interface. Using my example, my splash screen would have to be
packaged up into a bundle and started as early as possible in order to
trace as much of the framework startup event flow as possible.

Even if I rely on EclipseStarter.startup() rather than
EclipseStarter.run() to catch the returned BundleContext, I only get
that BundleContext back after the framework has booted in its
entirety, which would be too late to hook in something trying to
monitor its boot progress.

If I've missed some capability in Equinox, I'd like to hear about it.

Steven E. Harris