[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] Re: Creating and Starting a BundleActivator when the framework launches

Simon,

Sometimes it's easier to describe a solution in code rather than words... to that end, I knocked together bit of demo code that might help. You'll see that the code is really very simple.

Download from http://neilbartlett.name/downloads/earlyactivation.zip The source is inside the plugin JARs. There are three plugins:

1) "com...base" contains the abstract base class that scans bundles for the Bundle-ImmediateActivation header

2) "com...headless" is the bundle that you need to keep in your core embedded application, it will automatically install bundles that have the above header, no questions asked. You will have to start this bundle (only) through config.ini or your IPlatformRunnable.

3) "com...ui" is a convenience for using your bundles in a UI Eclipse application such as the SDK. It uses the org.eclipse.ui.startup extension point to ensure that it gets started, and it interacts with the user to ask if the bundle should really be started. NB this does NOT introduce a UI dependency into your model. If this UI bundle ends up in your embedded application it will simply be ignored (in fact, it won't resolve).

I think that the message from Jeff's (as always) well considered and helpful email is that everybody has different requirements for when bundles should be started. There's nothing wrong with your model, but to support it directly in the platform would unnecessarily foist it on people who want to do things another way. Since your model CAN be implemented without platform support, it SHOULD be.

Having said that, it would make a lot of sense for the most popular activation strategies to be implemented through a set of bundles that could perhaps be supported by the Equinox team.

Regards,
Neil

On 4/10/06, Simon J Archer <sarcher@xxxxxxxxxx> wrote:

Hi Gunnar

Everyone loves the UI!  I'm desperately trying to decouple my model from any UI, so this is not really an option.  And of course, yes, I am always trying to be OSGi implementation agnostic wherever possible.

Regards

Simon



Gunnar Wagenknecht < gunnar@xxxxxxxxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx

04/10/2006 08:50 AM

Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

To
equinox-dev@xxxxxxxxxxx
cc

Subject
[equinox-dev] Re: Creating and Starting a BundleActivator when the framework launches







Hi!

Simon J Archer wrote:
> The point of my
> posting is exactly this: My model-based bundle that registers a service
> is never started.  I hope now that you understand my dilemma.

Yes, this seems to be the root problem for this discussion. Do you stay
on Equinox or do your bundles need to run on different framework
implementations?

If Equinox only, you should try a workaround by defining required
bundles dependencies. I'm pretty sure that there is a consumer of this
service and that this consumer can be started lazy triggered by some
user actions.

Cu, Gunnar

--
Gunnar Wagenknecht
gunnar@xxxxxxxxxxxxxxx
http://wagenknecht.org/

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


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





--
Neil Bartlett
Senior Technical Consultant, Integility Ltd
Tel: +44 (0) 20 7043 8328
Fax: +44 (0) 20 7043 8329

LinkedIn Profile: https://www.linkedin.com/in/neilbartlett