Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Optional dependency
Optional dependency [message #325649] Mon, 25 February 2008 10:01 Go to next message
Eclipse UserFriend
Originally posted by: s.larsen.danskebank.dk

My situation is this:

I have made a very important plugin (X), which uses a very unimportant
(statistics) plugin (Y).
I want the X-plugin to work, even if Y-plugin is not present.

In X-plugin I have defined an optional dependency to Y-plugin.
The X-plugin is calling the Y-plugin in a seperate thread.

This actually works - but not very nice.
If the Y-plugin is not available I get this error from org.eclipse.ui:
Failed to execute runnable (java.lang.NoClassDefFoundError: Y-plugin)
and the thread is terminated.

So... my question is:
How can I from X-plugin, check if Y-plugin is available, so that I handle
it and omit trying to instantiate Y-plugin?

Regards
Steen Larsen
Re: Optional dependency [message #325651 is a reply to message #325649] Mon, 25 February 2008 10:29 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

I'd use Platform.getBundle("y") which will return null if the bundle
with this name is not found.

Tom

Steen Larsen schrieb:
> My situation is this:
>
> I have made a very important plugin (X), which uses a very unimportant
> (statistics) plugin (Y).
> I want the X-plugin to work, even if Y-plugin is not present.
>
> In X-plugin I have defined an optional dependency to Y-plugin.
> The X-plugin is calling the Y-plugin in a seperate thread.
>
> This actually works - but not very nice.
> If the Y-plugin is not available I get this error from org.eclipse.ui:
> Failed to execute runnable (java.lang.NoClassDefFoundError: Y-plugin)
> and the thread is terminated.
>
> So... my question is: How can I from X-plugin, check if Y-plugin is
> available, so that I handle it and omit trying to instantiate Y-plugin?
>
> Regards
> Steen Larsen
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Previous Topic:SingleLineRule() constructor
Next Topic:Eclipse Help System Bug?
Goto Forum:
  


Current Time: Sat Aug 17 06:29:36 GMT 2024

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

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

Back to the top