org.jppf.server.nio
Class LocalChannelSelector

java.lang.Object
  extended by org.jppf.utils.ThreadSynchronization
      extended by 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

Field Summary
 
Fields inherited from class org.jppf.utils.ThreadSynchronization
stopped
 
Constructor Summary
LocalChannelSelector(ChannelWrapper<?> channel)
          Initialize this selector with the specified channel.
 
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 org.jppf.utils.ThreadSynchronization
goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jppf.server.nio.ChannelSelector
wakeUp
 

Constructor Detail

LocalChannelSelector

public LocalChannelSelector(ChannelWrapper<?> channel)
Initialize this selector with the specified channel.

Parameters:
channel - the channel polled by this selector.
Method Detail

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.