Is there an interface equivalent to com.atlassian.jira.extension.Startable in Confluence?
This interface allows Components to be notified of when the JIRA application has started. (After the plugin system is initialised and components added to the dependency injection framework)
Community moderators have prevented the ability to post new answers.
InitializingBean may not be what you want. Your plugin will be initialised on system startup with the rest of the plugins, but there's no guarantee that Confluence is entirely ready to serve at that point.
To be notified when Confluence is started, create an event listener plugin module that listens for the ConfluenceReadyEvent.
ConfluenceReadyEvent seems to be the one but I can't manage to catch it within my plugin using an EventListener annotation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried writing an event listener module rather than using annotations?
http://confluence.atlassian.com/display/CONFDEV/Event+Listener+Module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'll try that thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It doesn't work either with an event listener module. too bad...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you were trying to get it working with annotations, did you register your event listener class with the EventPublisher?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes I did register my class with the EventPublisher in a afterPropertiesSet method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your best bet is probably the Shared Access Layers LifecycleAware interface[1]. onStart() is called when the application has been correctly started and this works for all products.
To use it implement it on a new object and register your object as a component [2] in your atlassian-plugin.xml. To make it visiable to the application you need to add <interface>com.atlassian.sal.api.lifecycle.LifecycleAware</interface> between the <component> tags.
[2] http://confluence.atlassian.com/display/JIRA/Component+Plugin+Module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can implement Spring's InitializingBean interface. While this interface isn't Confluence's specific (it will work for JIRA plugins as well), it's afterPropertiesSet() method will be called after initialization.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As Charles said it, if I use InitializingBean there's no guarantee that Confluence is entirely ready.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.