Package com.google.code.yanf4j.util
Class SelectorFactory
- java.lang.Object
-
- com.google.code.yanf4j.util.SelectorFactory
-
public class SelectorFactory extends Object
Temp selector factory,come from grizzly- Author:
- dennis zhuang
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_SELECTORSstatic longtimeoutThe timeout before we exit.
-
Constructor Summary
Constructors Constructor Description SelectorFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetMaxSelectors()Returns max selector pool sizestatic SelectorgetSelector()Get a exclusiveSelectorstatic voidreturnSelector(Selector s)Return theSelectorto the cachestatic voidsetMaxSelectors(int size)Set max selector pool size.
-
-
-
Field Detail
-
DEFAULT_MAX_SELECTORS
public static final int DEFAULT_MAX_SELECTORS
- See Also:
- Constant Field Values
-
timeout
public static final long timeout
The timeout before we exit.- See Also:
- Constant Field Values
-
-
Method Detail
-
setMaxSelectors
public static final void setMaxSelectors(int size) throws IOExceptionSet 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 exclusiveSelector- Returns:
Selector
-
returnSelector
public static final void returnSelector(Selector s)
Return theSelectorto the cache- Parameters:
s-Selector
-
-