Callbacks from plugin loading

I have some functionality that I would like to execute each time a plugin is loaded.

Seems simple enough. Perhaps so simple that I’m over thinking it?

Any ideas/pointers/suggestions welcome.

Is it about P2 plugins?
Might be appropriate to have a listener for com.atlassian.plugin.event.events.PluginEnabledEvent

Not exactly. But your reply did get me looking in the right place.

https://developer.atlassian.com/server/confluence/event-listener-module/

You can listen for plugin install/uninstall/enable/disable events. However, this will be unreliable when trying to listen for events about your own plugin. To trigger actions for these events, your modules should implement Spring lifecycle interfaces: InitializingBean and DisposableBean . The afterPropertiesSet() and destroy() methods on these interfaces will be called when the module is enabled or disabled

1 Like