Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community.event
Class PollEventDispatcher

java.lang.Object
  extended by com.jivesoftware.community.event.PollEventDispatcher

public class PollEventDispatcher
extends java.lang.Object

Dispatcher for PollEvents. Register PollListeners at runtime using the addListener(PollListener) method, or add a child Jive Property to the key "eventListeners.PollListener" to register a listener that will persist across restarts.

For example, to register the com.acme.CustomPollListener class as a persistent listener the following code could be used: // add persistent key to have the listener loaded and registered automatically at startup JiveGlobals.setJiveProperty("eventListeners.PollListener.customPollListener", "com.acme.CustomPollListener.class"); // now add it for this runtime instance PollEventDispatcher.addListener(new com.acme.CustomerPollListener());


Method Summary
 void addListener(PollListener listener)
          Adds an event listener to the dispatcher.
static void destroy()
          Destroy dispatcher.
 void dispatchEvent(PollEvent event)
          Dispatches an event to all listeners.
static PollEventDispatcher getInstance()
          Returns an event dispatcher instance.
 void removeListener(PollListener listener)
          Removes an event listener from the dispatcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PollEventDispatcher getInstance()
Returns an event dispatcher instance.

Returns:
an event dispatcher instance.

addListener

public void addListener(PollListener listener)
Adds an event listener to the dispatcher.

Parameters:
listener - the listener.

removeListener

public void removeListener(PollListener listener)
Removes an event listener from the dispatcher.

Parameters:
listener - the listener.

destroy

public static void destroy()
Destroy dispatcher. Intended to be used primarily during testing.


dispatchEvent

public void dispatchEvent(PollEvent event)
Dispatches an event to all listeners.

Parameters:
event - the event.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.