org.apache.zookeeper.server
Class NIOServerCnxnFactory
java.lang.Object
org.apache.zookeeper.server.ServerCnxnFactory
org.apache.zookeeper.server.NIOServerCnxnFactory
- All Implemented Interfaces:
- Runnable
public class NIOServerCnxnFactory
- extends ServerCnxnFactory
- implements Runnable
|
Constructor Summary |
NIOServerCnxnFactory()
Construct a new server connection factory which will accept an unlimited number
of concurrent connections from each client (up to the file descriptor
limits of the operating system). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NIOServerCnxnFactory
public NIOServerCnxnFactory()
throws IOException
- Construct a new server connection factory which will accept an unlimited number
of concurrent connections from each client (up to the file descriptor
limits of the operating system). startup(zks) must be called subsequently.
- Throws:
IOException
configure
public void configure(InetSocketAddress addr,
int maxcc)
throws IOException
- Specified by:
configure in class ServerCnxnFactory
- Throws:
IOException
getMaxClientCnxnsPerHost
public int getMaxClientCnxnsPerHost()
- Maximum number of connections allowed from particular host (ip)
- Specified by:
getMaxClientCnxnsPerHost in class ServerCnxnFactory
setMaxClientCnxnsPerHost
public void setMaxClientCnxnsPerHost(int max)
- Maximum number of connections allowed from particular host (ip)
- Specified by:
setMaxClientCnxnsPerHost in class ServerCnxnFactory
start
public void start()
- Specified by:
start in class ServerCnxnFactory
startup
public void startup(ZooKeeperServer zks)
throws IOException,
InterruptedException
- Specified by:
startup in class ServerCnxnFactory
- Throws:
IOException
InterruptedException
getLocalAddress
public InetSocketAddress getLocalAddress()
- Specified by:
getLocalAddress in class ServerCnxnFactory
getLocalPort
public int getLocalPort()
- Specified by:
getLocalPort in class ServerCnxnFactory
createConnection
protected NIOServerCnxn createConnection(SocketChannel sock,
SelectionKey sk)
throws IOException
- Throws:
IOException
run
public void run()
- Specified by:
run in interface Runnable
closeAll
public void closeAll()
- clear all the connections in the selector
- Specified by:
closeAll in class ServerCnxnFactory
shutdown
public void shutdown()
- Specified by:
shutdown in class ServerCnxnFactory
closeSession
public void closeSession(long sessionId)
- Specified by:
closeSession in class ServerCnxnFactory
join
public void join()
throws InterruptedException
- Specified by:
join in class ServerCnxnFactory
- Throws:
InterruptedException
getConnections
public Iterable<ServerCnxn> getConnections()
- Specified by:
getConnections in class ServerCnxnFactory
Copyright © 2013 The Apache Software Foundation