net.gleamynode.netty2
Interface EventDispatcher

All Known Subinterfaces:
OrderedEventDispatcherMBean, SimpleEventDispatcherMBean, ThreadPooledEventDispatcher, ThreadPooledEventDispatcherMBean
All Known Implementing Classes:
AbstractThreadPooledEventDispatcher, LowLatencyEventDispatcher, OrderedEventDispatcher, SimpleEventDispatcher

public interface EventDispatcher

Dispatches session events to SessionListener.

Netty provides two default implementations:

Version:
$Rev: 4 $, $Date: 2005-04-18 12:04:09 +0900 $
Author:
Trustin Lee (http://gleamynode.net/dev/)

Method Summary
 void fire(Event event)
          Fires the specified session event.
 void flush()
          (Optional operation) Flushes the buffered events.
 int getWaitingEventSize()
          Returns the number of session events that are still not dispatched to SessionListeners.
 

Method Detail

getWaitingEventSize

public int getWaitingEventSize()
Returns the number of session events that are still not dispatched to SessionListeners.


fire

public void fire(Event event)
Fires the specified session event.


flush

public void flush()
(Optional operation) Flushes the buffered events. This method is invoked by ReadController#processEvent(Event)and WriteController#processEvent(Event)after the expected I/O operations have been completed. So you can implement EventDispatcherto buffer the fireXXX calls and fire (flush) them here in actually.



Copyright © 2004-2007 Trustin Lee. All Rights Reserved.