pyrasun.eio
Class EIOEventManager

java.lang.Object
  extended bypyrasun.eio.EIOEventManager
All Implemented Interfaces:
java.lang.Runnable

public class EIOEventManager
extends java.lang.Object
implements java.lang.Runnable

EIOEventManager is the central I/O event dispatcher. You register EndpointCoordinator objects with this, to inform the event manager what type of endpoints you'll be dealing with, and adding in Endpoints when they are ready for handling some type of event ( READABILITY from the connection, WRITABILITY to the connection, ACCEPTABILITY to accept a new incoming connection).


Method Summary
 java.lang.String keyListing()
          For debugging purposes only - hooked into via Mr.
 void registerForEvents(Endpoint endpoint)
          Register an Endpoint with this event manager.
 void removeEndpoint(Endpoint endpoint)
          Removes an endpoint from this event manager.
 void run()
           
 void setTimeoutCB(TimeoutCB timeoutCB)
          Set a callback to be invoked if the selector times out with no I/O ready operations.
 void start()
          Get this manager rolling!
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setTimeoutCB

public void setTimeoutCB(TimeoutCB timeoutCB)
Set a callback to be invoked if the selector times out with no I/O ready operations.


registerForEvents

public void registerForEvents(Endpoint endpoint)
Register an Endpoint with this event manager. Once the manager is started, we'll start propogating events against this endpoint appropriately. The actual events are determined by the interests defined within the Endpoint. You only need to register in the manager once - future changes in interest will automatically re-register as appropriate.


removeEndpoint

public void removeEndpoint(Endpoint endpoint)
Removes an endpoint from this event manager. You don't need to call this in most cases, as we automatically cleanup when an Endpoint closes. So you'll only need this if you want a live endpoint to hang around but you don't want EIO events propogated against it.


start

public void start()
Get this manager rolling! Until start is called, the event manager won't actually do anything.


keyListing

public java.lang.String keyListing()
For debugging purposes only - hooked into via Mr. Telnet. If you've got the telnet service running, open up a telnet window and connect in here, type 'selectorDump', and watch the show!


run

public void run()
Specified by:
run in interface java.lang.Runnable

toString

public java.lang.String toString()


Pyrasun EmberIO