com.twitter.common.thrift.monitoring
Class TMonitoredServerSocket

java.lang.Object
  extended by org.apache.thrift.transport.TServerTransport
      extended by org.apache.thrift.transport.TServerSocket
          extended by com.twitter.common.thrift.monitoring.TMonitoredServerSocket

public class TMonitoredServerSocket
extends org.apache.thrift.transport.TServerSocket

Extension of TServerSocket that allows for tracking of connected clients.


Constructor Summary
TMonitoredServerSocket(InetSocketAddress bindAddr, ConnectionMonitor<InetSocketAddress> monitor)
           
TMonitoredServerSocket(InetSocketAddress bindAddr, int clientTimeout, ConnectionMonitor<InetSocketAddress> monitor)
           
TMonitoredServerSocket(int port, ConnectionMonitor<InetSocketAddress> monitor)
           
TMonitoredServerSocket(int port, int clientTimeout, ConnectionMonitor<InetSocketAddress> monitor)
           
TMonitoredServerSocket(ServerSocket serverSocket, ConnectionMonitor<InetSocketAddress> monitor)
           
TMonitoredServerSocket(ServerSocket serverSocket, int clientTimeout, ConnectionMonitor<InetSocketAddress> monitor)
           
 
Method Summary
protected  org.apache.thrift.transport.TSocket acceptImpl()
           
 void close()
           
 InetSocketAddress getAddress(org.apache.thrift.transport.TSocket socket)
           
 
Methods inherited from class org.apache.thrift.transport.TServerSocket
interrupt, listen
 
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

TMonitoredServerSocket

public TMonitoredServerSocket(ServerSocket serverSocket,
                              ConnectionMonitor<InetSocketAddress> monitor)

TMonitoredServerSocket

public TMonitoredServerSocket(ServerSocket serverSocket,
                              int clientTimeout,
                              ConnectionMonitor<InetSocketAddress> monitor)

TMonitoredServerSocket

public TMonitoredServerSocket(int port,
                              ConnectionMonitor<InetSocketAddress> monitor)
                       throws org.apache.thrift.transport.TTransportException
Throws:
org.apache.thrift.transport.TTransportException

TMonitoredServerSocket

public TMonitoredServerSocket(int port,
                              int clientTimeout,
                              ConnectionMonitor<InetSocketAddress> monitor)
                       throws org.apache.thrift.transport.TTransportException
Throws:
org.apache.thrift.transport.TTransportException

TMonitoredServerSocket

public TMonitoredServerSocket(InetSocketAddress bindAddr,
                              ConnectionMonitor<InetSocketAddress> monitor)
                       throws org.apache.thrift.transport.TTransportException
Throws:
org.apache.thrift.transport.TTransportException

TMonitoredServerSocket

public TMonitoredServerSocket(InetSocketAddress bindAddr,
                              int clientTimeout,
                              ConnectionMonitor<InetSocketAddress> monitor)
                       throws org.apache.thrift.transport.TTransportException
Throws:
org.apache.thrift.transport.TTransportException
Method Detail

getAddress

public InetSocketAddress getAddress(org.apache.thrift.transport.TSocket socket)

acceptImpl

protected org.apache.thrift.transport.TSocket acceptImpl()
                                                  throws org.apache.thrift.transport.TTransportException
Overrides:
acceptImpl in class org.apache.thrift.transport.TServerSocket
Throws:
org.apache.thrift.transport.TTransportException

close

public void close()
Overrides:
close in class org.apache.thrift.transport.TServerSocket