Class SelectorFactory
java.lang.Object
com.google.code.yanf4j.util.SelectorFactory
Temp selector factory,come from grizzly
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate static final org.slf4j.Loggerprivate static intThe number ofSelectorto create.Cache ofSelectorstatic final longThe timeout before we exit. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final intReturns max selector pool sizestatic final SelectorGet a exclusiveSelectorprivate static voidgrow(int size) IncreaseSelectorpool sizeprivate static voidreduce(int size) DecreaseSelectorpool sizestatic final voidReturn theSelectorto the cachestatic final voidsetMaxSelectors(int size) Set max selector pool size.
-
Field Details
-
DEFAULT_MAX_SELECTORS
public static final int DEFAULT_MAX_SELECTORS- See Also:
-
logger
private static final org.slf4j.Logger logger -
timeout
public static final long timeoutThe timeout before we exit.- See Also:
-
maxSelectors
private static int maxSelectorsThe number ofSelectorto create. -
selectors
-
-
Constructor Details
-
SelectorFactory
public SelectorFactory()
-
-
Method Details
-
setMaxSelectors
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
-
returnSelector
Return theSelectorto the cache- Parameters:
s-Selector
-
grow
IncreaseSelectorpool size- Throws:
IOException
-
reduce
private static void reduce(int size) DecreaseSelectorpool size
-