I have a custom listener that works fine, but when I restart Jira, this listener does not work until I reinstall my custom addon.
This is the Listener:
public class CodProyectoListener implements InitializingBean, DisposableBean {
private static final Logger log = LoggerFactory.getLogger(CodProyectoListener.class);
private EventPublisher eventPublisher;
private ApplicationProperties applicationProperties;
private CodProyectoUtils codProyectoUtils;
public CodProyectoListener(ApplicationProperties applicationProperties, EventPublisher eventPublisher, CodProyectoUtils codProyectoUtils) {
this.applicationProperties = applicationProperties;
this.eventPublisher = eventPublisher;
this.codProyectoUtils = codProyectoUtils;
}
@Override
public void destroy() throws Exception {
eventPublisher.unregister(this);
}
@Override
public void afterPropertiesSet() throws Exception {
eventPublisher.register(this);
}
.
.
.
}
And this is the atlassian-plugin.xml:
<component-import key="eventPublisher" interface="com.atlassian.event.api.EventPublisher"/>
<component key="eventListener" class="es.mutua.jira.addons.listener.CodProyectoListener">
<description>Recupera informacion sobre el CF Código Proyecto.</description>
</component>
Can someone help me?