public interface SelectorHandler
Modifier and Type | Interface and Description |
---|---|
static interface |
SelectorHandler.Task |
Modifier and Type | Field and Description |
---|---|
static SelectorHandler |
DEFAULT_SELECTOR_HANDLER
The default
SelectorHandler used by all created builder instances. |
Modifier and Type | Method and Description |
---|---|
void |
deregisterChannel(SelectorRunner selectorRunner,
SelectableChannel channel)
Deregister the channel from the
SelectorRunner 's Selector. |
void |
deregisterChannelAsync(SelectorRunner selectorRunner,
SelectableChannel channel,
CompletionHandler<RegisterChannelResult> completionHandler)
Deregister the channel from the
SelectorRunner 's Selector. |
void |
deregisterKeyInterest(SelectorRunner selectorRunner,
SelectionKey key,
int interest)
Deregisters SelectionKey interest.
|
void |
enque(SelectorRunner selectorRunner,
SelectorHandler.Task task,
CompletionHandler<SelectorHandler.Task> completionHandler)
Execute task in a selector thread.
|
void |
execute(SelectorRunner selectorRunner,
SelectorHandler.Task task,
CompletionHandler<SelectorHandler.Task> completionHandler)
Execute task in a selector thread.
|
long |
getSelectTimeout() |
boolean |
onSelectorClosed(SelectorRunner selectorRunner) |
void |
postSelect(SelectorRunner selectorRunner) |
boolean |
preSelect(SelectorRunner selectorRunner) |
void |
registerChannel(SelectorRunner selectorRunner,
SelectableChannel channel,
int interest,
Object attachment) |
void |
registerChannelAsync(SelectorRunner selectorRunner,
SelectableChannel channel,
int interest,
Object attachment,
CompletionHandler<RegisterChannelResult> completionHandler) |
void |
registerKeyInterest(SelectorRunner selectorRunner,
SelectionKey key,
int interest) |
Set<SelectionKey> |
select(SelectorRunner selectorRunner) |
static final SelectorHandler DEFAULT_SELECTOR_HANDLER
SelectorHandler
used by all created builder instances.long getSelectTimeout()
boolean preSelect(SelectorRunner selectorRunner) throws IOException
IOException
Set<SelectionKey> select(SelectorRunner selectorRunner) throws IOException
IOException
void postSelect(SelectorRunner selectorRunner) throws IOException
IOException
void registerKeyInterest(SelectorRunner selectorRunner, SelectionKey key, int interest) throws IOException
IOException
void deregisterKeyInterest(SelectorRunner selectorRunner, SelectionKey key, int interest) throws IOException
IOException
void registerChannel(SelectorRunner selectorRunner, SelectableChannel channel, int interest, Object attachment) throws IOException
IOException
void registerChannelAsync(SelectorRunner selectorRunner, SelectableChannel channel, int interest, Object attachment, CompletionHandler<RegisterChannelResult> completionHandler)
void deregisterChannel(SelectorRunner selectorRunner, SelectableChannel channel) throws IOException
SelectorRunner
's Selector.selectorRunner
- SelectorRunner
channel
- SelectableChannel
channel to deregisterIOException
void deregisterChannelAsync(SelectorRunner selectorRunner, SelectableChannel channel, CompletionHandler<RegisterChannelResult> completionHandler)
SelectorRunner
's Selector.selectorRunner
- SelectorRunner
channel
- SelectableChannel
channel to deregistercompletionHandler
- CompletionHandler
void execute(SelectorRunner selectorRunner, SelectorHandler.Task task, CompletionHandler<SelectorHandler.Task> completionHandler)
enque(org.glassfish.grizzly.nio.SelectorRunner, org.glassfish.grizzly.nio.SelectorHandler.Task, org.glassfish.grizzly.CompletionHandler)
,
this operation will execute the task immediately if the current
is a selector thread.selectorRunner
- task
- completionHandler
- void enque(SelectorRunner selectorRunner, SelectorHandler.Task task, CompletionHandler<SelectorHandler.Task> completionHandler)
execute(org.glassfish.grizzly.nio.SelectorRunner, org.glassfish.grizzly.nio.SelectorHandler.Task, org.glassfish.grizzly.CompletionHandler)
,
this operation will postpone the task execution if current thread
is a selector thread, and execute it during the next
select(org.glassfish.grizzly.nio.SelectorRunner)
iteration.selectorRunner
- task
- completionHandler
- boolean onSelectorClosed(SelectorRunner selectorRunner)
Copyright © 2015 Oracle Corporation. All rights reserved.