Ticket #366 (closed Enhancement: fixed)
Replace Interal Plugin Events by method overriding
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.1 |
Component: | DeepaMehta Standard Distribution | Version: | 4.0.12 |
Keywords: | Cc: | dgf, Malte | |
Complexity: | 5 | Area: | Application Framework / API |
Module: | deepamehta-core |
Description
It has proven too cumbersome for plugin developers that they must implement event interfaces to handle these 4 situations:
- PLUGIN_SERVICE_ARRIVED
- PLUGIN_SERVICE_GONE
- INITIALIZE_PLUGIN
- POST_INSTALL_PLUGIN
Actually the semantics of an "event" do *not* apply here. Instead these "events" are bound to a specific plugin, and no other plugin can listen to them (that's why they are called Internal Plugin Events). As a consequence these 4 should be realized as regular methods to be overriden by the specific plugin.
The distinction between regular Core Events and Internal Plugin Events should be dropped.
The 4 methods could be named
- serviceArrived()
- serviceGone()
- init()
- postInstall()
Change History
comment:2 Changed 12 years ago by Jörg Richter
Core: adapt plugins to core service change (#366).
Drop internal plugin event handlers.
See ticket 366.
comment:3 Changed 12 years ago by Jörg Richter
Core: drop internal plugin events (#366).
BREAKING CHANGES
4 event listener interfaces are dropped:
- InitializePluginListener?
- PostInstallPluginListener?
- PluginServiceArrivedListener?
- PluginServiceGoneListener?
To adapt your plugins:
1) remove respective "import"s and "implements"
2) rename listener methods:
initializePlugin() -> init()
postInstallPlugin() -> postInstall()
pluginServiceArrived() -> serviceArrived()
pluginServiceGone() -> serviceGone()
The listener method's arguments have not changed. Also @Override should remain.
These 4 former events are now declared as hook methods in the PluginActivator? base class.
See ticket 366.
comment:4 Changed 12 years ago by Jörg Richter
Core: adapt plugins to core service change (#366).
Drop internal plugin event handlers.
See ticket 366.
comment:5 Changed 12 years ago by Jörg Richter
Core: drop internal plugin events (#366).
BREAKING CHANGES
4 event listener interfaces are dropped:
- InitializePluginListener?
- PostInstallPluginListener?
- PluginServiceArrivedListener?
- PluginServiceGoneListener?
To adapt your plugins:
1) remove respective "import"s and "implements"
2) rename listener methods:
initializePlugin() -> init()
postInstallPlugin() -> postInstall()
pluginServiceArrived() -> serviceArrived()
pluginServiceGone() -> serviceGone()
The listener method's arguments have not changed. Also @Override should remain.
These 4 former events are now declared as hook methods in the PluginActivator? base class.
See ticket 366.
comment:6 Changed 12 years ago by Jörg Richter
Core: adapt plugins to core service change (#366).
Drop internal plugin event handlers.
See ticket 366.
Core: drop internal plugin events (#366).
BREAKING CHANGES
4 event listener interfaces are dropped:
To adapt your plugins:
1) remove respective "import"s and "implements"
2) rename listener methods:
The listener method's arguments have not changed. Also @Override should remain.
These 4 former events are now declared as hook methods in the PluginActivator? base class.
See ticket 366.