| java.lang.Object org.jgroups.blocks.BasicConnectionTable org.jgroups.blocks.ConnectionTableNIO
All known Subclasses: org.jgroups.tests.ConnectionTableDemo_NIO,
ConnectionTableNIO | public class ConnectionTableNIO extends BasicConnectionTable implements Runnable(Code) | | Manages incoming and outgoing TCP connections. For each outgoing message to destination P, if there
is not yet a connection for P, one will be created. Subsequent outgoing messages will use this
connection. For incoming messages, one server socket is created at startup. For each new incoming
client connecting, a new thread from a thread pool is allocated and listens for incoming messages
until the socket is closed by the peer. Sockets/threads with no activity will be killed
after some time.
Incoming messages from any of the sockets can be received by setting the message listener.
We currently require use_incoming_packet_handler=true (release 2.4 will support use_incoming_packet_handler=false
due to threadless stack support).
author: Bela Ban, Scott Marlow, Alex Fu |
Inner Class :public static class SelectorWriteHandler | |
Inner Class :public static class WriteRequest | |
Field Summary | |
final protected static Log | LOG |
Constructor Summary | |
public | ConnectionTableNIO(int srv_port) | public | ConnectionTableNIO(int srv_port, long reaper_interval, long conn_expire_time) | public | ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port) | public | ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, boolean doStart) | public | ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, long reaper_interval, long conn_expire_time) | public | ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, long reaper_interval, long conn_expire_time, boolean doStart) |
LOG | final protected static Log LOG(Code) | | |
ConnectionTableNIO | public ConnectionTableNIO(int srv_port) throws Exception(Code) | | Parameters: srv_port - throws: Exception - |
ConnectionTableNIO | public ConnectionTableNIO(int srv_port, long reaper_interval, long conn_expire_time) throws Exception(Code) | | Parameters: srv_port - Parameters: reaper_interval - Parameters: conn_expire_time - throws: Exception - |
ConnectionTableNIO | public ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port) throws Exception(Code) | | Parameters: r - Parameters: bind_addr - Parameters: external_addr - Parameters: srv_port - Parameters: max_port - throws: Exception - |
ConnectionTableNIO | public ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, long reaper_interval, long conn_expire_time) throws Exception(Code) | | Parameters: r - Parameters: bind_addr - Parameters: external_addr - Parameters: srv_port - Parameters: max_port - Parameters: reaper_interval - Parameters: conn_expire_time - throws: Exception - |
ConnectionTableNIO | public ConnectionTableNIO(Receiver r, InetAddress bind_addr, InetAddress external_addr, int srv_port, int max_port, long reaper_interval, long conn_expire_time, boolean doStart) throws Exception(Code) | | |
createServerSocket | protected ServerSocket createServerSocket(int start_port, int end_port) throws Exception(Code) | | Finds first available port starting at start_port and returns server socket. Sets srv_port
|
getProcessorKeepAliveTime | public int getProcessorKeepAliveTime()(Code) | | |
getProcessorMaxThreads | public int getProcessorMaxThreads()(Code) | | |
getProcessorMinThreads | public int getProcessorMinThreads()(Code) | | |
getProcessorQueueSize | public int getProcessorQueueSize()(Code) | | |
getProcessorThreads | public int getProcessorThreads()(Code) | | |
getReaderThreads | public int getReaderThreads()(Code) | | |
getWriterThreads | public int getWriterThreads()(Code) | | |
run | public void run()(Code) | | Acceptor thread. Continuously accept new connections and assign readhandler/writehandler
to them.
|
setProcessorKeepAliveTime | public void setProcessorKeepAliveTime(int m_processor_keepAliveTime)(Code) | | |
setProcessorMaxThreads | public void setProcessorMaxThreads(int m_processor_maxThreads)(Code) | | |
setProcessorMinThreads | public void setProcessorMinThreads(int m_processor_minThreads)(Code) | | |
setProcessorQueueSize | public void setProcessorQueueSize(int m_processor_queueSize)(Code) | | |
setProcessorThreads | public void setProcessorThreads(int m_processor_threads)(Code) | | |
setReaderThreads | public void setReaderThreads(int m_reader_threads)(Code) | | |
setWriterThreads | public void setWriterThreads(int m_writer_threads)(Code) | | |
stop | public void stop()(Code) | | Closes all open sockets, the server socket and all threads waiting for incoming messages
|
|
|