ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | oscar List | July 2005 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [oscar] Uninstall of System Bundles


Niclas Hedhman wrote:

Well, "installed" is a bit ambiguous in this case, as it is pre-instantiated bundles that are passed to Oscar in Oscar's constructor, and for Oscar to "start" when it is done with its stuff.

I think Marcel was confused about what you were asking. The passed in activators are not bundles. I just reused the BundleActivator interface as a way of extending the System Bundle so host applications of Oscar could interact with the running Oscar instance. With Oscar 2.0, I realize that this approach is not as flexible as it could be and I plan to investigate a new approach, which be more akin to installing bundles.

This is the sweet Exception.
org.osgi.framework.BundleException: Cannot uninstall the system bundle.
       at org.ungoverned.oscar.SystemBundle.uninstall(SystemBundle.java:238)
       at org.ops4j.silk.boot.internal.BootImpl.dismantle(BootImpl.java:146)

and after checking out the source, here is the relevant Oscar code;


class SystemBundle extends BundleImpl
:
   public synchronized void uninstall() throws BundleException
   {
       Oscar.debug("SystemBundle.uninstall()");
       throw new BundleException("Cannot uninstall the system bundle.");
   }

Also found this interesting comment;
// Spec says stop() on SystemBundle should return immediately and
// shutdown framework on another thread.

Which indicates that a stop() is the only thing expected.

Perhaps you should check out the spec, it is very helpful in such cases.

Page 42/43 of the R3 spec for the System Bundle:

start – Does nothing because the system bundle is already started.
stop – Returns immediately and shuts down the Framework on another thread.
update – Returns immediately, then stops and restarts the Framework on another thread. uninstall – The Framework must throw a BundleException indicating that the system bundle cannot be uninstalled.


Well, I am embedding Oscar, and part of the embedding is to bridge the OSGi world with the rest, so I instantiate two BundleActivators and place them on the activationList in Oscar's constructor. Since the Oscar now tells me that one of those (at least) is a SystemBundle, I am no longer sure what is expected from me. The objectweb website is currently no reachable from here either, so I can dig for more information (if there is any) :o(

Don't worry, you confusion is understandable. The spec doesn't really talk about embedding the framework into host applications, so this stuff is framework specific. I have been meaning to create a document that covers just such information, but have not had the time to do it. For Oscar 2.0, this type of information will become much more important, I think.

-> richard



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.