org.jppf.server.nio
Class LocalChannelSelector
java.lang.Object
org.jppf.utils.ThreadSynchronization
org.jppf.server.nio.LocalChannelSelector
- All Implemented Interfaces:
- ChannelSelector
public class LocalChannelSelector
- extends ThreadSynchronization
- implements ChannelSelector
Instances of this class act as a 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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocalChannelSelector
public LocalChannelSelector(ChannelWrapper<?> channel)
- Initialize this selector with the specified channel.
- Parameters:
channel - the channel polled by this selector.
select
public boolean select()
- This method blocks until the state of the channel has changed.
- Specified by:
select in interface ChannelSelector
- Returns:
- true if the channel state changed.
select
public boolean select(long timeout)
- This method blocks until the state of the channel has changed or the timeout expires, whichever happens first.
- Specified by:
select in interface ChannelSelector
- Parameters:
timeout - the maximum duration in milliseconds for this operation.
- Returns:
- true if the channel state changed.
selectNow
public boolean selectNow()
- Determine whether the channel state has changed and return immediately.
- Specified by:
selectNow in interface ChannelSelector
- Returns:
- true if the channel state changed.
getChannel
public ChannelWrapper<?> getChannel()
- Get the channel this selector is polling.
- Specified by:
getChannel in interface ChannelSelector
- Returns:
- a
ChannelWrapper instance.
Copyright © 2005-2010 JPPF Team.