Stop loading of a bundle. [message #102102] |
Thu, 29 November 2007 08:51  |
Eclipse User |
|
|
|
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigA93F841D404EA051EC15EDF6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
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, and
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"
--------------enigA93F841D404EA051EC15EDF6
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
iD8DBQFHTsPY50uB2zvyE8MRAs9CAKCexYDOeRsLbh/6wIDj+3GyPvC7GQCg l47O
wJF1GGxtoPZNSRimMh8Fkso=
=7lhU
-----END PGP SIGNATURE-----
--------------enigA93F841D404EA051EC15EDF6--
|
|
|
|
Re: Stop loading of a bundle. [message #102166 is a reply to message #102139] |
Thu, 29 November 2007 22:54  |
Eclipse User |
|
|
|
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.02568 seconds