org.jppf.server.nio
Interface ChannelSelector

All Known Implementing Classes:
LocalChannelSelector

public interface ChannelSelector

Interface for objects that act as an NIO selector for local (in-VM) channels.

Author:
Laurent Cohen

Method Summary
 ChannelWrapper<?> getChannel()
          Get the channel this selector is polling.
 boolean select()
          This method blocks until the state of the channel has changed.
 boolean select(long timeout)
          This method blocks until the state of the channel has changed or the timeout expires, whichever happens first.
 boolean selectNow()
          Determine whether the channel state has changed and return immediately.
 void wakeUp()
          Wake up this selector.
 

Method Detail

select

boolean select()
This method blocks until the state of the channel has changed.

Returns:
true if the channel state changed.

select

boolean select(long timeout)
This method blocks until the state of the channel has changed or the timeout expires, whichever happens first.

Parameters:
timeout - the maximum duration in milliseconds for this operation.
Returns:
true if the channel state changed.

selectNow

boolean selectNow()
Determine whether the channel state has changed and return immediately.

Returns:
true if the channel state changed.

wakeUp

void wakeUp()
Wake up this selector. If the selector was not engaged in a blocking operation, this method has no effect.


getChannel

ChannelWrapper<?> getChannel()
Get the channel this selector is polling.

Returns:
a ChannelWrapper instance.


Copyright © 2005-2010 JPPF Team.