Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Stop loading of a bundle.
Stop loading of a bundle. [message #102102] Thu, 29 November 2007 13:51 Go to next message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
Messages: 873
Registered: July 2009
Senior Member
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 #102139 is a reply to message #102102] Thu, 29 November 2007 16:13 Go to previous messageGo to next message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
Hi Ketan,

you could throw an NotLicensedException in your start method. That would prevent your bundle from starting....

regards
christian

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, 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"
>
Re: Stop loading of a bundle. [message #102166 is a reply to message #102139] Fri, 30 November 2007 03:54 Go to previous message
Ketan Padegaonkar is currently offline Ketan PadegaonkarFriend
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--
Previous Topic:JSF support?
Next Topic:Different start levels for different versions of a bundle
Goto Forum:
  


Current Time: Fri Apr 19 18:43:54 GMT 2024

Powered by FUDForum. Page generated in 0.03008 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top