org.apache.zookeeper.server
Class NIOServerCnxn
java.lang.Object
org.apache.zookeeper.server.NIOServerCnxn
- All Implemented Interfaces:
- ServerCnxn, Watcher
public class NIOServerCnxn
- extends Object
- implements Watcher, ServerCnxn
This class handles communication with clients using NIO. There is one per
client, but only one thread doing the communication.
Fields inherited from interface org.apache.zookeeper.server.ServerCnxn |
me |
NIOServerCnxn
public NIOServerCnxn(ZooKeeperServer zk,
SocketChannel sock,
SelectionKey sk,
NIOServerCnxn.Factory factory)
throws IOException
- Throws:
IOException
sendCloseSession
public void sendCloseSession()
- Specified by:
sendCloseSession
in interface ServerCnxn
disableRecv
public void disableRecv()
enableRecv
public void enableRecv()
getSessionTimeout
public int getSessionTimeout()
- Specified by:
getSessionTimeout
in interface ServerCnxn
toString
public String toString()
- Overrides:
toString
in class Object
close
public void close()
sendResponse
public void sendResponse(ReplyHeader h,
org.apache.jute.Record r,
String tag)
- Specified by:
sendResponse
in interface ServerCnxn
process
public void process(WatchedEvent event)
- Specified by:
process
in interface ServerCnxn
- Specified by:
process
in interface Watcher
finishSessionInit
public void finishSessionInit(boolean valid)
- Specified by:
finishSessionInit
in interface ServerCnxn
getSessionId
public long getSessionId()
- Specified by:
getSessionId
in interface ServerCnxn
setSessionId
public void setSessionId(long sessionId)
- Specified by:
setSessionId
in interface ServerCnxn
getAuthInfo
public ArrayList<Id> getAuthInfo()
- Specified by:
getAuthInfo
in interface ServerCnxn
getRemoteAddress
public InetSocketAddress getRemoteAddress()
- Specified by:
getRemoteAddress
in interface ServerCnxn
getStats
public ServerCnxn.Stats getStats()
- Specified by:
getStats
in interface ServerCnxn
Copyright © 2012 The Apache Software Foundation