pyrasun.eio
Class EIOEventDescriptor

java.lang.Object
  extended bypyrasun.eio.EIOEventDescriptor

public class EIOEventDescriptor
extends java.lang.Object

An EIOEventDescriptor contains information for how to handle a given event firing within a given context (generally, the context is per EndpointCoordinator). This defines how EIO will handle a given type of event for a given EndpointCoordinator, and lets you define things like how to pool threads for such events, the priority of threads for a pool dedicated to this type, number of greedy operations to try to perform, etc.


Constructor Summary
EIOEventDescriptor(EIOEvent event, boolean poolIt, boolean uniqueThread, boolean disabled)
          Create one of these suckers
EIOEventDescriptor(EIOEvent event, boolean poolIt, boolean uniqueThread, boolean disabled, boolean useSelectorThread)
          Create one of these suckers
 
Method Summary
 java.lang.Object cloneIt()
          Clones an EIOEventDescriptor prototypical instance for use in a specific context.
 boolean equals(java.lang.Object obj)
           
 EIOEvent event()
          Returns the EIOEvent that this descriptor, um, describes
 int getGreedyOps()
          Indicates the number of greedy operations EmberIO should try to perform when this event is activated.
 int getPoolSize()
          Returns the size of the thread pool for this event type.
 int getThreadPriority()
          Get the thread priority to use for dedicated thread pools against this event type
 int getThrottleLimit()
           
 int getThrottleRestart()
           
 java.lang.Class getWorkerClass()
          Not used
 java.lang.String getWorkerClassName()
          Not used
 int hashCode()
           
 boolean isDisabled()
          Returns true if we don't want any handling for this event type.
 boolean isPooled()
          Returns true if we want a dedicated thread pool for this event type
 void setGreedyOps(int greedyOps)
          Indicates the number of greedy operations EmberIO should try to perform when this event is activated.
 void setPoolSize(int poolSize)
          Set the dedicated thread pool size for this type.
 void setThreadPriority(int priority)
          Set the thread priority to use for dedicated thread pools against this event type
 void setThrottleLimit(int throttleLimit)
           
 void setThrottleRestart(int throttleRestart)
           
 void setUseBlockingIO(boolean useBlockingIO)
          Set to true if you want to use blocking I/O against this event type, false if you're truly cool and are going non-blocking.
 void setWorkerClassName(java.lang.String name)
          Not used
 java.lang.String toString()
           
 boolean useBlockingIO()
          Returns true if these events should be handled in a blocking manner, false if you'll be going non-blocking.
 boolean useSelectorThread()
          Returns true if we want this sucker to execute within the Selector's event thread loop.
 boolean useUniqueThread()
          Returns true if we want a dedicated, blocking thread allocated for this event type.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EIOEventDescriptor

public EIOEventDescriptor(EIOEvent event,
                          boolean poolIt,
                          boolean uniqueThread,
                          boolean disabled)
Create one of these suckers


EIOEventDescriptor

public EIOEventDescriptor(EIOEvent event,
                          boolean poolIt,
                          boolean uniqueThread,
                          boolean disabled,
                          boolean useSelectorThread)
Create one of these suckers

Method Detail

cloneIt

public java.lang.Object cloneIt()
Clones an EIOEventDescriptor prototypical instance for use in a specific context. note that this _only_ clones the prototypical information - other per-instance stuff is not cloned.


event

public EIOEvent event()
Returns the EIOEvent that this descriptor, um, describes


isDisabled

public boolean isDisabled()
Returns true if we don't want any handling for this event type.


isPooled

public boolean isPooled()
Returns true if we want a dedicated thread pool for this event type


useUniqueThread

public boolean useUniqueThread()
Returns true if we want a dedicated, blocking thread allocated for this event type. Only supported for ACCEPT events at the moment. Mutually exclusive with other pooling options.


useSelectorThread

public boolean useSelectorThread()
Returns true if we want this sucker to execute within the Selector's event thread loop. Only supported for READ events at this time.


getPoolSize

public int getPoolSize()
Returns the size of the thread pool for this event type. Only makes sense if isPooled() is true.


setPoolSize

public void setPoolSize(int poolSize)
Set the dedicated thread pool size for this type.


getWorkerClassName

public java.lang.String getWorkerClassName()
Not used


getWorkerClass

public java.lang.Class getWorkerClass()
Not used


setWorkerClassName

public void setWorkerClassName(java.lang.String name)
Not used


getThreadPriority

public int getThreadPriority()
Get the thread priority to use for dedicated thread pools against this event type


setThreadPriority

public void setThreadPriority(int priority)
Set the thread priority to use for dedicated thread pools against this event type


useBlockingIO

public boolean useBlockingIO()
Returns true if these events should be handled in a blocking manner, false if you'll be going non-blocking.


setUseBlockingIO

public void setUseBlockingIO(boolean useBlockingIO)
Set to true if you want to use blocking I/O against this event type, false if you're truly cool and are going non-blocking.


getGreedyOps

public int getGreedyOps()
Indicates the number of greedy operations EmberIO should try to perform when this event is activated. For example, for a READ descriptor, if greedy ops were set to 5, then EIO would try to read 5 objects at once before relinquishing control.


setGreedyOps

public void setGreedyOps(int greedyOps)
Indicates the number of greedy operations EmberIO should try to perform when this event is activated. For example, for a READ descriptor, if greedy ops were set to 5, then EIO would try to read 5 objects at once before relinquishing control.


setThrottleLimit

public void setThrottleLimit(int throttleLimit)

getThrottleLimit

public int getThrottleLimit()

setThrottleRestart

public void setThrottleRestart(int throttleRestart)

getThrottleRestart

public int getThrottleRestart()

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()

toString

public java.lang.String toString()


Pyrasun EmberIO