Skip navigation links


com.fatwire.cs.core.event
Class SimpleDispatcher<E extends Event,R extends ListenerRegistry<? extends Listener>>

java.lang.Object
  extended by com.fatwire.cs.core.event.SimpleDispatcher<E,R>

All Implemented Interfaces:
EventDispatcher<E,R>

public class SimpleDispatcher<E extends Event,R extends ListenerRegistry<? extends Listener>>
extends java.lang.Object
implements EventDispatcher<E,R>

This is a 'general purpose' EventDispatcher. Blocking Listeners are invoked in the same order they are returned from ListenerRegistry. All non-blocking Listeners are executed in parallel. Threads are pooled temporarily, after a period of inactivity idle threads are automatically reclaimed.
Override dispatchBlocking() and dispatchNonBlocking() to override dispatching mechods


Constructor Summary
SimpleDispatcher()
           

 

Method Summary
protected  void dispatchBlocking(E e)
           
 void dispatchEvent(E e)
          Dispatches the event to regisreted Listeners (See Listener modes for discussion on the intended behavior of this method).
protected  void dispatchNonBlocking(E e)
           
 void setRegistry(R reg)
          Sets (injects) a ListenerRegistry to be used for discovering Listeners.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

SimpleDispatcher

public SimpleDispatcher()

Method Detail

dispatchEvent

public void dispatchEvent(E e)
                   throws EventException
Description copied from interface: EventDispatcher
Dispatches the event to regisreted Listeners (See Listener modes for discussion on the intended behavior of this method).
Specified by:
dispatchEvent in interface EventDispatcher<E extends Event,R extends ListenerRegistry<? extends Listener>>
Parameters:
e - Event to be dispatched
Throws:
EventException - if the dispatch

dispatchBlocking

protected void dispatchBlocking(E e)
                         throws EventException
Throws:
EventException

dispatchNonBlocking

protected void dispatchNonBlocking(E e)
                            throws EventException
Throws:
EventException

setRegistry

public void setRegistry(R reg)
Description copied from interface: EventDispatcher
Sets (injects) a ListenerRegistry to be used for discovering Listeners.
Specified by:
setRegistry in interface EventDispatcher<E extends Event,R extends ListenerRegistry<? extends Listener>>

Skip navigation links


Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.