Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Plugin-Reloding

There are several issues related to plugin reloading that you may want to
consider:

- changing the definitiion of a plugin:  The plugin registry is loaded and
the prereq constraints resolved at startup time.  I fyou change the
definition of a plugin, htis changes the registry (which is effectively
read only after startup).  You would need to remove all the old elements
and add the new ones and reresolve.  There are many subtle cases where
dependencies change, version information change, ...

- class loader maintenance:  It is likely that certain bounded cases can be
handled by throwing away the relevant plugin classloaders and starting
again.  In the general case however, there may well be issues with
downstream plugins using classes from upstream plugins and plugins
supplying implementations (via extensions) to plugins on which they do not
explicitly rely.  Sideeffects would include the introduction of duplicate
classes, failure to properly re-activate a reloaded plugin, ... .  Some
progress may be made by reloading the plugin and all of its dependents.

- Some plugins scan the extensions in their extension points on activation.
If A supplies an extension to B and then A is reloaded/reactivated, there
is no lifecycle that would allow B to know it may have more/less/different
extensions in its extension points.  So for example, menu entries supplied
by A may not show up/go away/...

Most everyone would agree that reload and dynamic addition of plugins is
interesting.  Like Nick said, its great if you want to look at this problem
but be warned that it is not easy or perhaps even doable in the general
case.

Jeff



                                                                                                           
                      Nick_Edgar@xxxxxxx                                                                   
                      Sent by:                       To:      platform-ui-dev@xxxxxxxxxxx                  
                      platform-ui-dev-admin@         cc:                                                   
                      eclipse.org                    Subject: Re: [platform-ui-dev] Plugin-Reloding        
                                                                                                           
                                                                                                           
                      01/09/2002 02:44 PM                                                                  
                      Please respond to                                                                    
                      platform-ui-dev                                                                      
                                                                                                           
                                                                                                           



Kris,

As a starting point, here are a few key interfaces and methods:
In package org.eclipse.core.runtime,
- IPluginDescriptor describes a plugin (it need not be activated).
- Plugin is the main class representing a plugin once it has been
activated.
- IPluginRegistry is the registry of plugins, obtained from
Platform.getPluginRegistry()
- IConfigurationElement is an element within a plugin descriptor.
- The createExecutableExtension(...) methods on IConfigurationElement are
used to instantiate classes referred to by the plugin.
Search for references to this method to see where classes are instantiated
and where they're hung onto.

Nick





"N V S Rama Krishna" <ram_kri@xxxxxxxxx>
Sent by: platform-ui-dev-admin@xxxxxxxxxxx
01/09/02 04:14 PM
Please respond to platform-ui-dev


        To:     <platform-ui-dev@xxxxxxxxxxx>
        cc:
        Subject:        Re: [platform-ui-dev] Plugin-Reloding

Hi Nick,
      When I was going through your first two paragraphs I had many
answers
which match with the lines of your thrid paragraph ("It may be possible to
add support for.....).
      I definitely would love contributing to this. Now please tell me the
resouces that I have to go through or atleast point me to it so that I can
start my contribution to the same. Its very much like implementing your
hot-deployment in App Servers where in we reload the whole stuff with a
new
custom-classloader (I worked with one of this Application Server making
vendors, hence that knowledge). Ya!  ya ! I know its not all that simple
to
implement and that's exactly why I would like to explore this area and see
to it that none others face the difficulties I am facing while developing
some complex plugins with WSAD.
     Awaiting your mail with the required information and pointers to
appropriate resources. I have this Trial version 4.0 with me.
     Have a nice day !!

Regards,
kris

----- Original Message -----
From: <Nick_Edgar@xxxxxxx>
To: <platform-ui-dev@xxxxxxxxxxx>
Sent: Monday, January 07, 2002 8:57 AM
Subject: Re: [platform-ui-dev] Plugin-Reloding


> While it would be useful to be able to shut down and restart a plugin
> during plugin development, it's not clear that this is a trivial thing
to
> add simply because each plugin has its own classloader.
> There is no way to forcibly shutdown a classloader.
> A classloader is only garbage collected when there are no longer any
> references to it or any classes it has loaded, including any instances.
> To do so would require closing all open views and editors from the
plugin
> in question, resetting any activated action contributions to their
> pre-activated state, etc.
> If any references remained to any of these parts, the classloader would
> stick around.  This can easily happen, for example if a view hooks
itself
> as a part listener, but forgets to unhook on dispose().
> Note that it's not just UI components you need to be concerned with,
> either.  In fact, shutdown protocol would probably have to be added to
the
> Plugin class since a basic shutdown mechanism itself could not know how
to
> tell all parts to shutdown.
>
> It may be possible to add support for shutting down a plugin, by taking
a
> best effort approach at shutting down all its parts, then creating a new
> classloader for the plugin the next time it is activated.
> But this would not be a trivial effort to add.
>
> Our schedule is pretty well full for 2.0.  If you would like to
> investigate this area, we would certainly encourage you, and would be
> interested in any results you come up with.
>
> Nick
>
>
>
>
>
>
> "N V S Rama Krishna" <ram_kri@xxxxxxxxx>
> Sent by: platform-ui-dev-admin@xxxxxxxxxxx
> 01/02/02 07:41 PM
> Please respond to platform-ui-dev
>
>
>         To:     <platform-ui-dev@xxxxxxxxxxx>
>         cc:
>         Subject:        [platform-ui-dev] Plugin-Reloding
>
> Hi !
>    I strongly feel there should be a provision in WSAD with which one
can
> reload the plugin instead of closing down the IDE and then starting it
> again. Since each plugin is loaded by a different class-loader
> implementing this shouldnt be a deal !!!
>    Any comments on this ?
>
> Regards,
> Kris
>
>
> _______________________________________________
> platform-ui-dev mailing list
> platform-ui-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/platform-ui-dev


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev



_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev






Back to the top