com.sun.grizzly.util
Class SelectorFactory

java.lang.Object
  extended by com.sun.grizzly.util.SelectorFactory

public class SelectorFactory
extends Object

Factory used to dispatch/share Selector.

Author:
Scott Oaks, Jean-Francois Arcand

Field Summary
static int DEFAULT_MAX_SELECTORS
           
static long timeout
          The timeout before we exit.
 
Constructor Summary
SelectorFactory()
           
 
Method Summary
static int getMaxSelectors()
          Returns max selector pool size
static Selector getSelector()
          Get a exclusive Selector
static void returnSelector(Selector s)
          Return the Selector to the cache
static void setMaxSelectors(int size)
          Set max selector pool size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_SELECTORS

public static final int DEFAULT_MAX_SELECTORS
See Also:
Constant Field Values

timeout

public static long timeout
The timeout before we exit.

Constructor Detail

SelectorFactory

public SelectorFactory()
Method Detail

setMaxSelectors

public static final void setMaxSelectors(int size)
                                  throws IOException
Set max selector pool size.

Parameters:
size - max pool size
Throws:
IOException

getMaxSelectors

public static final int getMaxSelectors()
Returns max selector pool size

Returns:
max pool size

getSelector

public static final Selector getSelector()
Get a exclusive Selector

Returns:
Selector

returnSelector

public static final void returnSelector(Selector s)
Return the Selector to the cache

Parameters:
s - Selector


Copyright © 2011 SUN Microsystems. All Rights Reserved.