fulmine.util.io
Interface ISelectionKeyTask

All Superinterfaces:
IDestroyable
All Known Implementing Classes:
AbstractSelectionKeyTask, DelegatingSelectionKeyTask, TcpConnection

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 fulmine.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.

Parameters:
selectionKey - the selection key for this


Copyright © 2007-2009. All Rights Reserved.