|
|
Re: Stop loading of a bundle. [message #102166 is a reply to message #102139] |
Fri, 30 November 2007 03:54 |
Ketan Padegaonkar Messages: 873 Registered: July 2009 |
Senior Member |
|
|
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigF34BB350B5AB9C59E84EE8AB
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Christian Campo wrote:
> Hi Ketan,
>=20
> you could throw an NotLicensedException in your start method. That woul=
d
> prevent your bundle from starting....
Thanks, I'll try this out.
> regards
> christian
>=20
> Ketan Padegaonkar schrieb:
>> Hi,
>>
>> I'd like to stop loading a bundle when some prerequisite is not met
>> (licensing being one of them).
>>
>> The easiest that I can do for now is to shutdown eclipse when the
>> prerequisite is not met. I do not however want to use this approach, a=
nd
>> would want to let users use eclipse, but not my plugins.
>>
>> Calling getBundle().stop() from within Plugin#start(BundleContext
>> context) gives me an "org.osgi.framework.BundleException: State change=
>> in progress for bundle ...", and the bundle does not stop.
>>
>> I'm trying something like this:
>>
>> public void start(BundleContext context) throws Exception {
>> super.start(context);
>> if (!checkPrerequisites())
>> getBundle.stop();
>> }
>>
>> Is there a better way around this ?
>>
>> Cheers,
>> Ketan Padegaonkar
>> I blog... therefore I am... http://ketan.padegaonkar.name/
>>
>> The farther you go, the less you know.
>> -- Lao Tsu, "Tao Te Ching"
>>
--=20
Ketan Padegaonkar
I blog... therefore I am... http://ketan.padegaonkar.name/
The farther you go, the less you know.
-- Lao Tsu, "Tao Te Ching"
--------------enigF34BB350B5AB9C59E84EE8AB
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHT4l/50uB2zvyE8MRAkmoAJ9wPVbjWu2jP51IgLlMn+nw2hOy4QCg x8U1
QgxYuIbMsM6AbLtvkeCQ9XA=
=s2s+
-----END PGP SIGNATURE-----
--------------enigF34BB350B5AB9C59E84EE8AB--
|
|
|
Powered by
FUDForum. Page generated in 0.03263 seconds