Not really. Fragments are not bundle in that they do not have a class loader or a separate activation life. They can be attached to zero or more host bundles (non-fragment bundles). So to start them is not possible. To make it a no-op will break an invariant: After callings start, the bundle must be STARTING/ACTIVE or an exception is thrown to indicate failure to start. Since a fragment can not be started, that means an exception must be thrown.
Generally, unless you are writing a management agent, you probably should not be starting/stopping bundles. If you are writing a management agent, then the distinction between fragments and bundles is important to to manage.
--
BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
BJ Hargrave
Senior Technical Staff Member, IBM // office: +1 386 848 1781
OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788
hargr...@us.ibm.com
----- Original message -----
From: Benson Margulies <bimargul...@gmail.com>
Sent by: osgi-dev-boun...@mail.osgi.org
To: OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Cc:
Subject: [osgi-dev] Why is 'start' an error for fragments?
Date: Thu, Nov 10, 2016 10:59 AM
Has there ever been consideration of making 'start' be a harmless
no-op for fragment bundles? I keep having to write code to check the
headers and avoid the call to start on fragments.
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev