Package org.jgroups.blocks.cs
Class NioBaseServer
- java.lang.Object
- 
- org.jgroups.blocks.cs.BaseServer
- 
- org.jgroups.blocks.cs.NioBaseServer
 
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable,- ConnectionListener
 
 public abstract class NioBaseServer extends BaseServer - Since:
- 3.6.5
- Author:
- Bela Ban
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classNioBaseServer.Acceptor- 
Nested classes/interfaces inherited from class org.jgroups.blocks.cs.BaseServerBaseServer.Reaper
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected java.lang.Threadacceptorprotected booleancopy_on_partial_writeprotected intmax_send_buffersprotected intnum_selectsprotected longreader_idle_timeprotected java.util.concurrent.locks.Lockreg_lockprotected booleanregistrationprotected java.nio.channels.Selectorselector- 
Fields inherited from class org.jgroups.blocks.cs.BaseServerclient_bind_addr, client_bind_port, conn_expire_time, conn_listeners, conns, defer_client_binding, factory, linger, local_addr, log, max_length, reaper, reaperInterval, receiver, recv_buf_size, running, send_buf_size, sock_conn_timeout, sock_creation_lock, socket_factory, tcp_nodelay, time_service, use_peer_connections
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedNioBaseServer(ThreadFactory f, SocketFactory sf)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidacceptorDone()booleanacceptorRunning()booleancopyOnPartialWrite()NioBaseServercopyOnPartialWrite(boolean b)protected NioConnectioncreateConnection(Address dest)Creates a new connection object to target dest, but doesn't yet connect itprotected voidhandleAccept(java.nio.channels.SelectionKey key)intmaxSendBuffers()NioBaseServermaxSendBuffers(int num)intnumPartialWrites()intnumSelects()java.lang.StringprintBuffers()Prints send and receive buffers for all connectionslongreaderIdleTime()NioBaseServerreaderIdleTime(long t)protected java.nio.channels.SelectionKeyregister(java.nio.channels.SelectableChannel ch, int interest_ops, NioConnection conn)booleanselectorOpen()- 
Methods inherited from class org.jgroups.blocks.cs.BaseServeraddConnection, addConnectionListener, clearConnections, clientBindAddress, clientBindAddress, clientBindPort, clientBindPort, close, closeConnection, connectionClosed, connectionEstablished, connectionEstablishedTo, connExpireTime, connExpireTimeout, deferClientBinding, deferClientBinding, explanation, getConnection, getMaxLength, getNumConnections, getNumOpenConnections, hasConnection, linger, linger, localAddress, localAddress, log, log, notifyConnectionClosed, notifyConnectionEstablished, printConnections, reaperInterval, reaperInterval, receive, receive, receive, receiveBufferSize, receiveBufferSize, receiver, receiver, removeConnectionIfPresent, removeConnectionListener, replaceConnection, retainAll, running, send, send, sendBufferSize, sendBufferSize, sendToAll, sendToAll, setMaxLength, socketConnectionTimeout, socketConnectionTimeout, socketFactory, socketFactory, start, stop, tcpNodelay, tcpNodelay, timeService, timeService, toString, usePeerConnections, usePeerConnections, validateArgs
 
- 
 
- 
- 
- 
Field Detail- 
selectorprotected java.nio.channels.Selector selector 
 - 
acceptorprotected java.lang.Thread acceptor 
 - 
reg_lockprotected final java.util.concurrent.locks.Lock reg_lock 
 - 
registrationprotected volatile boolean registration 
 - 
max_send_buffersprotected int max_send_buffers 
 - 
num_selectsprotected int num_selects 
 - 
copy_on_partial_writeprotected boolean copy_on_partial_write 
 - 
reader_idle_timeprotected long reader_idle_time 
 
- 
 - 
Constructor Detail- 
NioBaseServerprotected NioBaseServer(ThreadFactory f, SocketFactory sf) 
 
- 
 - 
Method Detail- 
maxSendBufferspublic int maxSendBuffers() 
 - 
maxSendBufferspublic NioBaseServer maxSendBuffers(int num) 
 - 
selectorOpenpublic boolean selectorOpen() 
 - 
acceptorRunningpublic boolean acceptorRunning() 
 - 
numSelectspublic int numSelects() 
 - 
copyOnPartialWritepublic boolean copyOnPartialWrite() 
 - 
readerIdleTimepublic long readerIdleTime() 
 - 
readerIdleTimepublic NioBaseServer readerIdleTime(long t) 
 - 
copyOnPartialWritepublic NioBaseServer copyOnPartialWrite(boolean b) 
 - 
numPartialWritespublic int numPartialWrites() 
 - 
printBufferspublic java.lang.String printBuffers() Prints send and receive buffers for all connections
 - 
registerprotected java.nio.channels.SelectionKey register(java.nio.channels.SelectableChannel ch, int interest_ops, NioConnection conn) throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
createConnectionprotected NioConnection createConnection(Address dest) throws java.lang.Exception Description copied from class:BaseServerCreates a new connection object to target dest, but doesn't yet connect it- Specified by:
- createConnectionin class- BaseServer
- Throws:
- java.lang.Exception
 
 - 
handleAcceptprotected void handleAccept(java.nio.channels.SelectionKey key) throws java.lang.Exception- Throws:
- java.lang.Exception
 
 - 
acceptorDoneprotected void acceptorDone() 
 
- 
 
-