Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » how to communicate between two plugins
how to communicate between two plugins [message #466526] Fri, 20 April 2007 08:23 Go to next message
Eclipse UserFriend
Originally posted by: johansusai.yahoo.co.in

I have two seperate plugin's say pluginA n pluginB, i want to a
pass a value as argument from pluginA to plugin B.so i exported pluginB as jar and i included that jar in PluginA's manifest file [Build : Extra class path entries], now i found no compilation error.But while exporting it and running the application i am getting error. I think PluginB's method is not resolved at run time.
Kindly help me out to solve this issue.
thanks in Advance.
Re: how to communicate between two plugins [message #466528 is a reply to message #466526] Fri, 20 April 2007 08:31 Go to previous messageGo to next message
Eclipse UserFriend
Johanantonysusai,

If you embed a plug-in JAR inside another plug-in, then it's not a plug-in any more. "pluginB" is now just a library JAR, and Eclipse will not recognize it as a plug-in.

The answer to your question depends on what you mean by "communication" between your plug-ins. I suggest you read up on Eclipse's inter-plugin dependency mechanism, and when you understand that, read about "extensions" and "extension points".

Regards,
Neil
Re: how to communicate between two plugins [message #466538 is a reply to message #466528] Fri, 20 April 2007 09:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johansusai.yahoo.co.in

Neil,

Thanks for your suggestion. kindly help me how to access methods in a class of one plugin from different plugin.

Thanks,
Johan
Re: how to communicate between two plugins [message #466540 is a reply to message #466538] Fri, 20 April 2007 10:03 Go to previous messageGo to next message
Eclipse UserFriend
What Neil is trying to tell you is that you have not understood the
plugin mechanism from OSGI and ECLIPSE. So the first thing you need to
do is read up on your OSGI, Eclipse skills and then come back if you
still have no understood the problem you are having.

Good starting points are:

http://www.eclipse.org/resources/ - Provides a list of resources for
eclipse development
http://wiki.eclipse.org/index.php/Main_Page - Eclipse wiki especially
look at the Official Eclipse FAQ.

Regards
Stefan

Johanantonysusai schrieb:
> Neil,
>
> Thanks for your suggestion. kindly help me how to access methods in a class of one plugin from different plugin.
>
> Thanks,
> Johan
Re: how to communicate between two plugins [message #466556 is a reply to message #466540] Fri, 20 April 2007 16:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rhafernik.site-controls.com

I'm pretty much a newbie, but I think what they're trying to tell you
is "don't do that". The very nature of a "plugin" is that it isn't
dependent on another "plugin" - especially at compile time. If you do
this, you've made it so that both plugins must be loaded if one ever is
and that's probably going to cause trouble down the way.

If the two plugins are so tightly coupled that one must call the
methods of the other, maybe they can be merged into one plugin?

Or, could you split some of your code off into a jar that is loaded by
both plugins?

As I said, I'm just a newbie, but cross-plugin dependencies seem like
the very sort of thing Eclipse was invented to prevent.

~rob

On 2007-04-20 09:03:28 -0500, Stefan Langer <mailtolanger@googlemail.com> said:

> What Neil is trying to tell you is that you have not understood the
> plugin mechanism from OSGI and ECLIPSE. So the first thing you need to
> do is read up on your OSGI, Eclipse skills and then come back if you
> still have no understood the problem you are having.
>
> Good starting points are:
>
> http://www.eclipse.org/resources/ - Provides a list of resources for
> eclipse development
> http://wiki.eclipse.org/index.php/Main_Page - Eclipse wiki especially
> look at the Official Eclipse FAQ.
>
> Regards
> Stefan
>
> Johanantonysusai schrieb:
>> Neil,
>>
>> Thanks for your suggestion. kindly help me how to access methods in a
>> class of one plugin from different plugin.
>> Thanks,
>> Johan
Re: how to communicate between two plugins [message #466560 is a reply to message #466556] Fri, 20 April 2007 16:56 Go to previous messageGo to next message
Eclipse UserFriend
While I agree that it's a good idea to keep plug-ins as independent as
possible, it's also very common to refer to classes/interfaces in other
plug-ins. Plug-ins often consist of a publicly accessible API and an
internal implementation (in Eclipse, these packages contain the "internal"
keyword).

To Johanantonysusai, I also, second the suggestion that you do some
reading on OSGi and plug-in dependencies. The short answer, though, is:

* In the manifest for plug-in B, go to the Runtime tab and export the
packages that you want to make visible to other plug-ins.

* In the manifest for plug-in A, go to the Dependencies tab and add a
dependency on Plug-in B.

You should now be able to reference plug-in B classes in plug-in A.

--- Patrick
patrick@rcpquickstart.com


Rob Hafernik wrote:

> I'm pretty much a newbie, but I think what they're trying to tell you
> is "don't do that". The very nature of a "plugin" is that it isn't
> dependent on another "plugin" - especially at compile time. If you do
> this, you've made it so that both plugins must be loaded if one ever is
> and that's probably going to cause trouble down the way.

> If the two plugins are so tightly coupled that one must call the
> methods of the other, maybe they can be merged into one plugin?

> Or, could you split some of your code off into a jar that is loaded by
> both plugins?

> As I said, I'm just a newbie, but cross-plugin dependencies seem like
> the very sort of thing Eclipse was invented to prevent.

> ~rob

> On 2007-04-20 09:03:28 -0500, Stefan Langer <mailtolanger@googlemail.com>
said:

>> What Neil is trying to tell you is that you have not understood the
>> plugin mechanism from OSGI and ECLIPSE. So the first thing you need to
>> do is read up on your OSGI, Eclipse skills and then come back if you
>> still have no understood the problem you are having.
>>
>> Good starting points are:
>>
>> http://www.eclipse.org/resources/ - Provides a list of resources for
>> eclipse development
>> http://wiki.eclipse.org/index.php/Main_Page - Eclipse wiki especially
>> look at the Official Eclipse FAQ.
>>
>> Regards
>> Stefan
>>
>> Johanantonysusai schrieb:
>>> Neil,
>>>
>>> Thanks for your suggestion. kindly help me how to access methods in a
>>> class of one plugin from different plugin.
>>> Thanks,
>>> Johan
Re: how to communicate between two plugins [message #466613 is a reply to message #466560] Mon, 23 April 2007 01:26 Go to previous message
Eclipse UserFriend
Originally posted by: johansusai.yahoo.co.in

Patrick,

its working fine, Thank You for giving me a solution.
Previous Topic:About custom widget and rcp
Next Topic:[Help] Hibernate-Annotation and Eclipse RCP
Goto Forum:
  


Current Time: Thu May 15 19:58:35 EDT 2025

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

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

Back to the top