Skip to main content



      Home
Home » Newcomers » Newcomers » Setting up execution order of plugins on startup
Setting up execution order of plugins on startup [message #270267] Tue, 14 April 2009 05:46 Go to next message
Eclipse UserFriend
Hi,

I have 2 plugins (say plugin1 nd plugin2) for Eclipse that has extension
points for org.eclipse.ui.startup and implements IStartup. Now when I
start my eclipse both of these plugins gets loaded and do whatever I have
implemented in the earlyStartup() method.
I observed that sometimes implementation of plugin1 happens before the
implementation of plugin2 is triggered and sometimes the order is reversed.

So, my question is how can I set the execution/loading of plugins order so
that every time plugin1 gets loaded first rather than plugin2?

Thanks in advance.
Re: Setting up execution order of plugins on startup [message #270269 is a reply to message #270267] Tue, 14 April 2009 06:49 Go to previous messageGo to next message
Eclipse UserFriend
ankit baphna wrote:
> Hi,
>
> I have 2 plugins (say plugin1 nd plugin2) for Eclipse that has extension
> points for org.eclipse.ui.startup and implements IStartup. Now when I
> start my eclipse both of these plugins gets loaded and do whatever I
> have implemented in the earlyStartup() method. I observed that sometimes
> implementation of plugin1 happens before the implementation of plugin2
> is triggered and sometimes the order is reversed.
>
> So, my question is how can I set the execution/loading of plugins order
> so that every time plugin1 gets loaded first rather than plugin2?
>
> Thanks in advance.
>

One way would be by setting up the dependency (using manifest editor). If you want P1 to be loaded before P2, make P2 dependent on P1. This way P1 should et loaded first.

Runtime Spy might help you too ( http://www.ibm.com/developerworks/opensource/library/os-ecsp y1/)

--
hth,
Ankur..
Re: Setting up execution order of plugins on startup [message #270291 is a reply to message #270267] Tue, 14 April 2009 14:24 Go to previous message
Eclipse UserFriend
"ankit baphna" <anki_daiict@yahoo.com> wrote in message
news:5132ce46001b93ec7f258ad91337df12$1@www.eclipse.org...
> Hi,
>
> I have 2 plugins (say plugin1 nd plugin2) for Eclipse that has extension
> points for org.eclipse.ui.startup and implements IStartup. Now when I
> start my eclipse both of these plugins gets loaded and do whatever I have
> implemented in the earlyStartup() method. I observed that sometimes
> implementation of plugin1 happens before the implementation of plugin2 is
> triggered and sometimes the order is reversed.
>
> So, my question is how can I set the execution/loading of plugins order so
> that every time plugin1 gets loaded first rather than plugin2?


If the order of startup matters, you may be trying to do too much in your
startup methods.

Instead, try to defer meaningful initialization until when the functionality
is actually needed.

Use plugin dependencies to provide compilation dependencies (e.g., plugin B
references a class defined in plugin A). Use extensions and extension
points to provide runtime dependencies (e.g., plugin A defines an interface
X, and exposes an extension point; plugin B depends on A, extends the
extension point, and provides implementation class Y at runtime).

There are some special cases where those rules are not sufficient, but they
cover 95% of the cases. If those rules aren't attainable in your case,
carefully examine your design to see if it has to be so. You may be making
your life harder than it needs to be.
Previous Topic:Who should log an Exception
Next Topic:GUI builder for new projects
Goto Forum:
  


Current Time: Thu May 08 21:40:45 EDT 2025

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

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

Back to the top