org.apache.thrift.transport
Class TNonblockingServerSocket

java.lang.Object
  extended by org.apache.thrift.transport.TServerTransport
      extended by org.apache.thrift.transport.TNonblockingServerTransport
          extended by org.apache.thrift.transport.TNonblockingServerSocket

public class TNonblockingServerSocket
extends TNonblockingServerTransport

Wrapper around ServerSocketChannel


Constructor Summary
TNonblockingServerSocket(java.net.InetSocketAddress bindAddr)
           
TNonblockingServerSocket(java.net.InetSocketAddress bindAddr, int clientTimeout)
           
TNonblockingServerSocket(int port)
          Creates just a port listening server socket
TNonblockingServerSocket(int port, int clientTimeout)
          Creates just a port listening server socket
 
Method Summary
protected  TNonblockingSocket acceptImpl()
           
 void close()
           
 void interrupt()
          Optional method implementation.
 void listen()
           
 void registerSelector(java.nio.channels.Selector selector)
           
 
Methods inherited from class org.apache.thrift.transport.TServerTransport
accept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TNonblockingServerSocket

public TNonblockingServerSocket(int port)
                         throws TTransportException
Creates just a port listening server socket

Throws:
TTransportException

TNonblockingServerSocket

public TNonblockingServerSocket(int port,
                                int clientTimeout)
                         throws TTransportException
Creates just a port listening server socket

Throws:
TTransportException

TNonblockingServerSocket

public TNonblockingServerSocket(java.net.InetSocketAddress bindAddr)
                         throws TTransportException
Throws:
TTransportException

TNonblockingServerSocket

public TNonblockingServerSocket(java.net.InetSocketAddress bindAddr,
                                int clientTimeout)
                         throws TTransportException
Throws:
TTransportException
Method Detail

listen

public void listen()
            throws TTransportException
Specified by:
listen in class TServerTransport
Throws:
TTransportException

acceptImpl

protected TNonblockingSocket acceptImpl()
                                 throws TTransportException
Specified by:
acceptImpl in class TServerTransport
Throws:
TTransportException

registerSelector

public void registerSelector(java.nio.channels.Selector selector)
Specified by:
registerSelector in class TNonblockingServerTransport

close

public void close()
Specified by:
close in class TServerTransport

interrupt

public void interrupt()
Description copied from class: TServerTransport
Optional method implementation. This signals to the server transport that it should break out of any accept() or listen() that it is currently blocked on. This method, if implemented, MUST be thread safe, as it may be called from a different thread context than the other TServerTransport methods.

Overrides:
interrupt in class TServerTransport