pyrasun.eio
Class EIOGlobalContext

java.lang.Object
  extended bypyrasun.eio.EIOGlobalContext

public class EIOGlobalContext
extends java.lang.Object

Defines a global context to provide critical services that cut across many EIO classes. Global in this case is a slight misnomer that C++ people will misunderstand, but Java people will get - it's "global" for a large collection of EIO stuff, but differing classloaders/usage scenarios means you may very well have multiple global contexts.


Constructor Summary
EIOGlobalContext(int maxEM, java.lang.String name)
           
 
Method Summary
 void criticalError(EIOReasonCode code, java.lang.Exception e, java.lang.String msg, java.lang.Object context)
           
 void eldumperoo()
           
 EIOEventManager getEventManager()
          Get a handle on _a_ event manager.
 Logger getLogger(java.lang.Class category)
          Get a logger instance for the specified category (in the form of a class)
 Logger getLogger(java.lang.Object object)
          Get a logger instance for the specified category (in the form of a class)
 Logger getLogger(java.lang.String category)
          Get a logger instance for the specified category
 EIOEventHandler getMeAHandler(EIOEvent event)
           
 java.lang.ThreadGroup getThreadGroup()
          Get this context's EIO thread group.
 java.lang.Thread newThread(java.lang.Runnable target)
          Create a new EIO thread within this context's EIO thread group.
 void registerCoordinator(EndpointCoordinator coordinator)
           
 void setEventHandler(java.lang.Class clazz, EIOEvent event)
          Override an event handler.
 void setGlobalListener(EIOGlobalListener listener)
           
 void setLogger(LoggerManager loggerMan)
          Set the logger used by everybody in this EIO context.
 void setNumEventManagers(int numMannies)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EIOGlobalContext

public EIOGlobalContext(int maxEM,
                        java.lang.String name)
                 throws java.io.IOException
Method Detail

newThread

public java.lang.Thread newThread(java.lang.Runnable target)
Create a new EIO thread within this context's EIO thread group.


getThreadGroup

public java.lang.ThreadGroup getThreadGroup()
Get this context's EIO thread group.


setGlobalListener

public void setGlobalListener(EIOGlobalListener listener)

criticalError

public void criticalError(EIOReasonCode code,
                          java.lang.Exception e,
                          java.lang.String msg,
                          java.lang.Object context)

start

public void start()

stop

public void stop()

setLogger

public void setLogger(LoggerManager loggerMan)
Set the logger used by everybody in this EIO context. Will typically be either log4j or (shudder) JDK1.4 logging. Considering strongly to disallow commons logging with a nasty IllegalArgumentException :-)....


getLogger

public Logger getLogger(java.lang.String category)
Get a logger instance for the specified category


getLogger

public Logger getLogger(java.lang.Class category)
Get a logger instance for the specified category (in the form of a class)


getLogger

public Logger getLogger(java.lang.Object object)
Get a logger instance for the specified category (in the form of a class)


setNumEventManagers

public void setNumEventManagers(int numMannies)

getEventManager

public EIOEventManager getEventManager()
Get a handle on _a_ event manager. Which one you get is up to the EIO core (yes, there can be multiple ones). Users generally shouldn't need to do this, as EIOEventManagers are now internally managed. Look to EndpointCoordinator instead.


setEventHandler

public void setEventHandler(java.lang.Class clazz,
                            EIOEvent event)
Override an event handler. Intended for customized I/O events where someone is creating their own new I/O stuff and they want a custom Event Handler for it.

Parameters:
clazz - Class which extends EIOEventHandler and contains an empty constructor.
event - Event which you want to provide a custom handler for. And if you override of the pre-packaged event handlers you'd better know what the hell you're doing!
See Also:
EIOEventHandler

getMeAHandler

public EIOEventHandler getMeAHandler(EIOEvent event)

eldumperoo

public void eldumperoo()

registerCoordinator

public void registerCoordinator(EndpointCoordinator coordinator)


Pyrasun EmberIO