mirrormap.nio
Interface ISelectionKeyTask

All Superinterfaces:
IDestroyable
All Known Implementing Classes:
TcpConnectionEndPoint

public interface ISelectionKeyTask
extends IDestroyable

A task that is associated with a SelectionKey. This task is registered with the SelectorTasks. Upon registration, this receives the selection key via the setSelectionKey(SelectionKey) method.

When the registered NIO Channel has an operation ready for processing, the run() method of this will be executed by the thread running the SelectorTasks.process() method.

Implementations must be efficient; any thread blocking will prevent other Channel ready operations from being processed by the SelectorTasks.process().

Author:
Ramon Servadei

Method Summary
 void run()
          Run the task associated with the operation and selection key
 void setSelectionKey(SelectionKey selectionKey)
          Receives the selection key returned from the SelectableChannel.register(java.nio.channels.Selector, int) method called during the SelectorTasks.register(int, SelectableChannel, ISelectionKeyTask) method.
 
Methods inherited from interface mirrormap.lifecycle.IDestroyable
destroy
 

Method Detail

run

void run()
Run the task associated with the operation and selection key


setSelectionKey

void setSelectionKey(SelectionKey selectionKey)
Receives the selection key returned from the SelectableChannel.register(java.nio.channels.Selector, int) method called during the SelectorTasks.register(int, SelectableChannel, ISelectionKeyTask) method. This is the key associated with this task.

Parameters:
selectionKey - the selection key associated with this task


Copyright © 2010. All Rights Reserved.