Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How To Share A POJO Across Plugins?
How To Share A POJO Across Plugins? [message #323616] Thu, 03 January 2008 22:04 Go to next message
Eclipse UserFriend
Originally posted by: anupgokhale.rediffmail.com

I have two plugins Plugin1 & Plugin2 in a RCP app. I want Plugin2 to have
read/write access to a POJO created in Plugin1. Any pointers on how to do
this?

Regards,
Anup Gokhale
Re: How To Share A POJO Across Plugins? [message #323617 is a reply to message #323616] Thu, 03 January 2008 22:47 Go to previous messageGo to next message
Eclipse UserFriend
Plugin2 needs to have a dependency on Plugin1.

Open the project manifest (select the project, right-click PDE Tools ->
Open Manifest).

Select the dependencies tab and add Plugin1 as a dependency.

Then it just works.

Anup Gokhale wrote:
> I have two plugins Plugin1 & Plugin2 in a RCP app. I want Plugin2 to
> have read/write access to a POJO created in Plugin1. Any pointers on how
> to do this?
>
> Regards,
> Anup Gokhale
>
Re: How To Share A POJO Across Plugins? [message #323619 is a reply to message #323617] Fri, 04 January 2008 00:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anupgokhale.rediffmail.com

Thanks Francis. But my problem is a bit more complicated. In some
installations of my RCP app, both the plugins will be present, but in some
installations only Plugin2 will be present. So essentially what i need to
do is to access a POJO from Plugin1 ONLY if it has been installed. I guess
I can used the extension points mechanism to do this, but have absolutely
no idea on how to proceed.

Regards,
Anup Gokhale

> Plugin2 needs to have a dependency on Plugin1.

> Open the project manifest (select the project, right-click PDE Tools ->
> Open Manifest).

> Select the dependencies tab and add Plugin1 as a dependency.

> Then it just works.

> Anup Gokhale wrote:
>> I have two plugins Plugin1 & Plugin2 in a RCP app. I want Plugin2 to
>> have read/write access to a POJO created in Plugin1. Any pointers on how
>> to do this?
>>
Re: How To Share A POJO Across Plugins? [message #323620 is a reply to message #323619] Fri, 04 January 2008 01:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ronbermejo.nospamm.com

Anup Gokhale wrote:

> Thanks Francis. But my problem is a bit more complicated. In some
> installations of my RCP app, both the plugins will be present, but in some
> installations only Plugin2 will be present. So essentially what i need to
> do is to access a POJO from Plugin1 ONLY if it has been installed. I guess
> I can used the extension points mechanism to do this, but have absolutely
> no idea on how to proceed.

> Regards,
> Anup Gokhale

Hello Anup,

This sounds like it could use OSGi services. You could register your POJO
as a service from Plugin1 (see
http://www.eclipsezone.com/eclipse/forums/t90688.html).

Plugin2 can then "consume" this service (see
http://www.eclipsezone.com/eclipse/forums/t90796.html and
http://www.eclipsezone.com/eclipse/forums/t91059.html).

Hth!
Ron
Re: How To Share A POJO Across Plugins? [message #323621 is a reply to message #323620] Fri, 04 January 2008 01:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anupgokhale.rediffmail.com

Ron Bermejo wrote:

> Hello Anup,

> This sounds like it could use OSGi services. You could register your POJO
> as a service from Plugin1 (see
> http://www.eclipsezone.com/eclipse/forums/t90688.html).

> Plugin2 can then "consume" this service (see
> http://www.eclipsezone.com/eclipse/forums/t90796.html and
> http://www.eclipsezone.com/eclipse/forums/t91059.html).

> Hth!
> Ron

Ahhhhhh... seems like quite a bundle (no pun intended!) for me to read and
digest. There goes my lunch break! Thanks to you Ron.

Regards,
Anup Gokhale
Re: How To Share A POJO Across Plugins? [message #323644 is a reply to message #323619] Fri, 04 January 2008 12:46 Go to previous message
Eclipse UserFriend
You can set Plugin1 as optional (right click on Plugin1 in the
Dependencies Tab of the Manifest editor and select Properties).
You can check if Plugin1 exists using

Platform.getBundle("Plugin1") != null

Snjeza

Anup Gokhale wrote:
> Thanks Francis. But my problem is a bit more complicated. In some
> installations of my RCP app, both the plugins will be present, but in
> some installations only Plugin2 will be present. So essentially what i
> need to do is to access a POJO from Plugin1 ONLY if it has been
> installed. I guess I can used the extension points mechanism to do this,
> but have absolutely no idea on how to proceed.
>
> Regards,
> Anup Gokhale
>
>> Plugin2 needs to have a dependency on Plugin1.
>
>> Open the project manifest (select the project, right-click PDE Tools
>> -> Open Manifest).
>
>> Select the dependencies tab and add Plugin1 as a dependency.
>
>> Then it just works.
>
>> Anup Gokhale wrote:
>>> I have two plugins Plugin1 & Plugin2 in a RCP app. I want Plugin2 to
>>> have read/write access to a POJO created in Plugin1. Any pointers on
>>> how to do this?
>>>
>
>
Previous Topic:SWT-Swing Problem!
Next Topic:Debugger very very slow.
Goto Forum:
  


Current Time: Sat Jul 19 18:10:35 EDT 2025

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

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

Back to the top