com.sun.grizzly.nio
Class DefaultSelectorHandler

java.lang.Object
  extended by com.sun.grizzly.nio.DefaultSelectorHandler
All Implemented Interfaces:
SelectorHandler

public class DefaultSelectorHandler
extends Object
implements SelectorHandler

Default implementation of NIO SelectorHandler

Author:
Alexey Stashok

Nested Class Summary
protected static class DefaultSelectorHandler.OpType
           
protected static class DefaultSelectorHandler.SelectionKeyOperation
           
 
Field Summary
protected  long selectTimeout
           
 
Constructor Summary
DefaultSelectorHandler()
           
 
Method Summary
protected  void addPendingOperation(SelectorRunner selectorRunner, DefaultSelectorHandler.SelectionKeyOperation operation)
           
 long getSelectTimeout()
           
 void postSelect(SelectorRunner selectorRunner)
           
 void preSelect(SelectorRunner selectorRunner)
           
protected  void processPendingOperation(SelectorRunner selectorRunner, DefaultSelectorHandler.SelectionKeyOperation operation)
           
protected  void processPendingOperations(SelectorRunner selectorRunner)
           
 void registerChannel(SelectorRunner selectorRunner, SelectableChannel channel, int interest, Object attachment)
           
 Future<RegisterChannelResult> registerChannelAsync(SelectorRunner selectorRunner, SelectableChannel channel, int interest, Object attachment, CompletionHandler<RegisterChannelResult> completionHandler)
           
 void registerKey(SelectorRunner selectorRunner, SelectionKey key, int interest)
           
 Set<SelectionKey> select(SelectorRunner selectorRunner)
           
 void setSelectTimeout(long selectTimeout)
           
 void unregisterKey(SelectorRunner selectorRunner, SelectionKey key, int interest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectTimeout

protected long selectTimeout
Constructor Detail

DefaultSelectorHandler

public DefaultSelectorHandler()
Method Detail

getSelectTimeout

public long getSelectTimeout()
Specified by:
getSelectTimeout in interface SelectorHandler

setSelectTimeout

public void setSelectTimeout(long selectTimeout)
Specified by:
setSelectTimeout in interface SelectorHandler

preSelect

public void preSelect(SelectorRunner selectorRunner)
               throws IOException
Specified by:
preSelect in interface SelectorHandler
Throws:
IOException

select

public Set<SelectionKey> select(SelectorRunner selectorRunner)
                         throws IOException
Specified by:
select in interface SelectorHandler
Throws:
IOException

postSelect

public void postSelect(SelectorRunner selectorRunner)
                throws IOException
Specified by:
postSelect in interface SelectorHandler
Throws:
IOException

registerKey

public void registerKey(SelectorRunner selectorRunner,
                        SelectionKey key,
                        int interest)
                 throws IOException
Specified by:
registerKey in interface SelectorHandler
Throws:
IOException

unregisterKey

public void unregisterKey(SelectorRunner selectorRunner,
                          SelectionKey key,
                          int interest)
                   throws IOException
Specified by:
unregisterKey in interface SelectorHandler
Throws:
IOException

registerChannel

public void registerChannel(SelectorRunner selectorRunner,
                            SelectableChannel channel,
                            int interest,
                            Object attachment)
                     throws IOException
Specified by:
registerChannel in interface SelectorHandler
Throws:
IOException

registerChannelAsync

public Future<RegisterChannelResult> registerChannelAsync(SelectorRunner selectorRunner,
                                                          SelectableChannel channel,
                                                          int interest,
                                                          Object attachment,
                                                          CompletionHandler<RegisterChannelResult> completionHandler)
                                                   throws IOException
Specified by:
registerChannelAsync in interface SelectorHandler
Throws:
IOException

addPendingOperation

protected void addPendingOperation(SelectorRunner selectorRunner,
                                   DefaultSelectorHandler.SelectionKeyOperation operation)

processPendingOperations

protected void processPendingOperations(SelectorRunner selectorRunner)
                                 throws IOException
Throws:
IOException

processPendingOperation

protected void processPendingOperation(SelectorRunner selectorRunner,
                                       DefaultSelectorHandler.SelectionKeyOperation operation)
                                throws IOException
Throws:
IOException


Copyright © 2009 SUN Microsystems. All Rights Reserved.