org.khelekore.rnio.impl
Class UnlimitedSocketHandler<T extends SelectableChannel>

java.lang.Object
  extended by org.khelekore.rnio.impl.UnlimitedSocketHandler<T>
All Implemented Interfaces:
SocketChannelHandler
Direct Known Subclasses:
Acceptor, SimpleBlockReader, SimpleBlockSender

public abstract class UnlimitedSocketHandler<T extends SelectableChannel>
extends Object
implements SocketChannelHandler

A socket handler that never times out and always runs on the selector thread.

Author:
Robert Olofsson

Field Summary
 NioHandler nioHandler
           
 T sc
           
 
Constructor Summary
UnlimitedSocketHandler(T sc, NioHandler nioHandler)
           
 
Method Summary
 void closed()
          Signal that the channel has been closed.
 String getDescription()
          Returns the class name.
 Long getTimeout()
          Will return null to indicate no timeout on accepts.
 void timeout()
          Handle timeouts.
 boolean useSeparateThread()
          Will always run on the selector thread so return false.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sc

public final T extends SelectableChannel sc

nioHandler

public final NioHandler nioHandler
Constructor Detail

UnlimitedSocketHandler

public UnlimitedSocketHandler(T sc,
                              NioHandler nioHandler)
Method Detail

getTimeout

public Long getTimeout()
Will return null to indicate no timeout on accepts.

Specified by:
getTimeout in interface SocketChannelHandler
Returns:
the time when this operation times out, null if no timeout is set.

getDescription

public String getDescription()
Returns the class name.

Specified by:
getDescription in interface SocketChannelHandler

useSeparateThread

public boolean useSeparateThread()
Will always run on the selector thread so return false.

Specified by:
useSeparateThread in interface SocketChannelHandler
Returns:
false

timeout

public void timeout()
Handle timeouts. We should not get any timeout.

Specified by:
timeout in interface SocketChannelHandler

closed

public void closed()
Description copied from interface: SocketChannelHandler
Signal that the channel has been closed.

Specified by:
closed in interface SocketChannelHandler