com.atlassian.greenhopper
Class EventListenerRegistry

java.lang.Object
  extended by com.atlassian.greenhopper.EventListenerRegistry

@Service
public class EventListenerRegistry
extends java.lang.Object

Takes care of Listeners for JIRA events. Event listeners must be handled by the plugin itself, since neither JIRA nor Plugin Framework clear out registered listeners when the plugin context goes down. If listeners stay behind they'd keep a reference to the GH classloader around from inside JIRA.

Author:
ahennecke

Nested Class Summary
static class EventListenerRegistry.ListenerKey
           
 
Field Summary
protected  LoggerWrapper log
           
 
Constructor Summary
EventListenerRegistry()
           
 
Method Summary
 java.lang.Object getListener(EventListenerRegistry.ListenerKey key)
          Get a previously registered event listener
 void registerListener(EventListenerRegistry.ListenerKey key, java.lang.Object listener)
          Register an event listener with JIRA
 void unregisterAll()
          Unregister all event listeners from JIRA that have been registered here
 void unregisterListener(EventListenerRegistry.ListenerKey key)
          Unregister an event listener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final LoggerWrapper log
Constructor Detail

EventListenerRegistry

public EventListenerRegistry()
Method Detail

registerListener

public void registerListener(EventListenerRegistry.ListenerKey key,
                             java.lang.Object listener)
Register an event listener with JIRA

Parameters:
key - : the internal key to keep a reference to the listener under
listener - : the event listener to register

unregisterAll

public void unregisterAll()
Unregister all event listeners from JIRA that have been registered here


unregisterListener

public void unregisterListener(EventListenerRegistry.ListenerKey key)
Unregister an event listener

Parameters:
key - : the internal key the listener is stored against

getListener

public java.lang.Object getListener(EventListenerRegistry.ListenerKey key)
Get a previously registered event listener

Parameters:
key - : the internal key the listener is stored against


Copyright © 2007-2014 Atlassian. All Rights Reserved.