com.atlassian.event.legacy
Class SpringContextEventPublisher

java.lang.Object
  extended by com.atlassian.event.legacy.SpringContextEventPublisher
All Implemented Interfaces:
EventListener, org.springframework.context.ApplicationContextAware

public class SpringContextEventPublisher
extends java.lang.Object
implements org.springframework.context.ApplicationContextAware, EventListener

An event listener for all Spring application events so that they get published to the actual Spring context.

Simply register this against your Spring context to handle event the same 'old' way

Since:
2.0.0

Constructor Summary
SpringContextEventPublisher()
           
 
Method Summary
 java.lang.Class[] getHandledEventClasses()
          Determine which event classes this listener is interested in.
 void handleEvent(Event event)
          Perform some action as a response to a Confluence event.
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringContextEventPublisher

public SpringContextEventPublisher()
Method Detail

handleEvent

public void handleEvent(Event event)
Description copied from interface: EventListener
Perform some action as a response to a Confluence event. The EventManager will ensure that this is only called if the class of the event matches one of the classes returned by getHandledEventClasses

Specified by:
handleEvent in interface EventListener
Parameters:
event - some event triggered within Confluence

getHandledEventClasses

public java.lang.Class[] getHandledEventClasses()
Description copied from interface: EventListener
Determine which event classes this listener is interested in.

The EventManager performs rudimentary filtering of events by their class. If you want to receive only a subset of events passing through the system, return an array of the Classes you wish to listen for from this method.

Listening for a class will also listen for all its subclasses. (And listening for an interface will listen for any implementation of that interface)

Returning an empty array will allow you to receive every event.

Specified by:
getHandledEventClasses in interface EventListener
Returns:
An array of the event classes that this event listener is interested in, or an empty array if the listener should receive all events. Must not return null.

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware


Copyright © 2006-2011 Atlassian. All Rights Reserved.