public class NioEndpoint extends AbstractEndpoint
NioEndpoint
NIO2 endpoint, providing the following services:
Modifier and Type | Class and Description |
---|---|
protected class |
NioEndpoint.Acceptor
Acceptor |
static class |
NioEndpoint.ChannelInfo
ChannelInfo |
protected class |
NioEndpoint.ChannelProcessor
ChannelProcessor |
protected class |
NioEndpoint.ChannelWithOptionsProcessor
ChannelWithOptionsProcessor |
protected static class |
NioEndpoint.DefaultThreadFactory
DefaultThreadFactory
The default thread factory
Created on Mar 6, 2012 at 9:11:20 AM |
class |
NioEndpoint.EventPoller
EventPoller
Created on Mar 26, 2012 at 12:51:53 PM |
static interface |
NioEndpoint.Handler
Handler |
protected class |
NioEndpoint.HandshakeHandler
HandshakeHandler |
class |
NioEndpoint.Sendfile
Sendfile
Created on Mar 7, 2012 at 4:04:59 PM |
static class |
NioEndpoint.SendfileData
SendfileData class.
|
Modifier and Type | Field and Description |
---|---|
protected NioEndpoint.Handler |
handler
Handling of accepted sockets.
|
protected boolean |
internalExecutor
Using an internal executor.
|
protected NioEndpoint.Sendfile |
sendfile
The static file sender.
|
protected NioServerSocketChannelFactory |
serverSocketChannelFactory |
protected SSLContext |
sslContext
SSL context.
|
acceptorThreadCount, address, backlog, counter, curThreads, curThreadsBusy, daemon, DEFAULT_SO_TIMEOUT, deferAccept, executor, initialized, keepAliveTimeout, maxConnections, maxThreads, name, paused, port, reuseAddress, reverseConnection, running, sendfileSize, sequence, soLinger, soReceiveBuffer, soSendBuffer, soTimeout, SSLCACertificateFile, SSLCACertificatePath, SSLCARevocationFile, SSLCARevocationPath, SSLCertificateChainFile, SSLCertificateFile, SSLCertificateKeyFile, SSLCipherSuite, SSLEnabled, SSLInsecureRenegotiation, SSLPassword, SSLProtocol, SSLVerifyClient, SSLVerifyDepth, tcpNoDelay, threadFactory, threadPriority, useSendfile
Constructor and Description |
---|
NioEndpoint()
Create a new instance of
NioEndpoint |
Modifier and Type | Method and Description |
---|---|
void |
addEventChannel(NioChannel channel,
long timeout,
boolean read,
boolean write,
boolean resume,
boolean wakeup)
Add specified channel and associated pool to the poller.
|
void |
addEventChannel(NioChannel channel,
long timeout,
int flags)
|
boolean |
addSendfileData(NioEndpoint.SendfileData data)
Add a send file data to the queue of static files
|
void |
closeChannel(NioChannel channel)
Close the specified channel and remove it from the list of open
connections
|
void |
destroy()
Deallocate the memory pools, and close server socket.
|
int |
getCurrentThreadCount()
Return the amount of threads that are managed by the pool.
|
int |
getCurrentThreadsBusy()
Return the amount of threads currently busy.
|
NioEndpoint.Handler |
getHandler() |
int |
getKeepAliveCount()
Number of keep-alive channels.
|
NioEndpoint.SendfileData |
getSendfileData() |
NioServerSocketChannelFactory |
getServerSocketChannelFactory()
Getter for serverSocketChannelFactory
|
SSLContext |
getSslContext()
Getter for sslContext
|
void |
init()
Initialize the endpoint
|
boolean |
processChannel(NioChannel channel,
SocketStatus status)
Process given channel for an event.
|
protected boolean |
processChannelWithOptions(NioChannel channel)
Process given channel.
|
void |
removeEventChannel(NioChannel channel)
Remove the channel from the list of venet channels
|
protected boolean |
setChannelOptions(NioChannel channel)
Configure the channel options before being processed
|
void |
setHandler(NioEndpoint.Handler handler) |
void |
setServerSocketChannelFactory(NioServerSocketChannelFactory serverSocketChannelFactory)
Setter for the serverSocketChannelFactory
|
void |
setSslContext(SSLContext sslContext)
Setter for the sslContext
|
void |
start()
Start the endpoint, creating acceptor, poller and sendfile threads, etc.
|
void |
stop()
Stop the endpoint.
|
getAcceptorThreadCount, getAddress, getBacklog, getCurThreads, getCurThreadsBusy, getDaemon, getDeferAccept, getExecutor, getKeepAliveTimeout, getMaxConnections, getMaxThreads, getName, getPort, getSendfileSize, getSequence, getSoLinger, getSoReceiveBuffer, getSoSendBuffer, getSoTimeout, getSSLCACertificateFile, getSSLCACertificatePath, getSSLCARevocationFile, getSSLCARevocationPath, getSSLCertificateChainFile, getSSLCertificateFile, getSSLCertificateKeyFile, getSSLCipherSuite, getSSLEnabled, getSSLInsecureRenegotiation, getSSLPassword, getSSLProtocol, getSSLVerifyClient, getSSLVerifyDepth, getTcpNoDelay, getThreadPriority, getUseSendfile, isInitialized, isPaused, isReuseAddress, isReverseConnection, isRunning, newThread, pause, resume, setAcceptorThreadCount, setAddress, setBacklog, setCurThreads, setCurThreadsBusy, setDaemon, setDeferAccept, setExecutor, setInitialized, setKeepAliveTimeout, setMaxConnections, setMaxThreads, setName, setPaused, setPort, setReuseAddress, setReverseConnection, setRunning, setSendfileSize, setSequence, setSoLinger, setSoReceiveBuffer, setSoSendBuffer, setSoTimeout, setSSLCACertificateFile, setSSLCACertificatePath, setSSLCARevocationFile, setSSLCARevocationPath, setSSLCertificateChainFile, setSSLCertificateFile, setSSLCertificateKeyFile, setSSLCipherSuite, setSSLEnabled, setSSLInsecureRenegotiation, setSSLPassword, setSSLProtocol, setSSLVerifyClient, setSSLVerifyDepth, setTcpNoDelay, setThreadPriority, setUseSendfile, unlockAccept
protected NioEndpoint.Handler handler
protected NioServerSocketChannelFactory serverSocketChannelFactory
protected SSLContext sslContext
protected NioEndpoint.Sendfile sendfile
protected boolean internalExecutor
public void setHandler(NioEndpoint.Handler handler)
handler
- public NioEndpoint.Handler getHandler()
public int getKeepAliveCount()
public int getCurrentThreadCount()
public int getCurrentThreadsBusy()
public SSLContext getSslContext()
public void setSslContext(SSLContext sslContext)
sslContext
- the sslContext to setpublic void init() throws Exception
AbstractEndpoint
init
in class AbstractEndpoint
Exception
public void start() throws Exception
AbstractEndpoint
start
in class AbstractEndpoint
Exception
public void stop()
AbstractEndpoint
stop
in class AbstractEndpoint
public void destroy() throws Exception
AbstractEndpoint
destroy
in class AbstractEndpoint
Exception
protected boolean setChannelOptions(NioChannel channel)
public void addEventChannel(NioChannel channel, long timeout, boolean read, boolean write, boolean resume, boolean wakeup)
channel
- the channel to add to the pollertimeout
- to use for this connectionread
- to do read pollingwrite
- to do write pollingresume
- to send a callback eventwakeup
- addEventChannel(NioChannel, long, int)
public void addEventChannel(NioChannel channel, long timeout, int flags)
channel
- the channel to add to the pollertimeout
- the channel timeoutflags
- a merge of read, write, resume and wake up event typesaddEventChannel(NioChannel, long, boolean, boolean, boolean,
boolean)
public void removeEventChannel(NioChannel channel)
channel
- public boolean addSendfileData(NioEndpoint.SendfileData data)
data
- SendfileData
, else FALSEprotected boolean processChannelWithOptions(NioChannel channel)
public boolean processChannel(NioChannel channel, SocketStatus status)
channel
- status
- public NioServerSocketChannelFactory getServerSocketChannelFactory()
public void setServerSocketChannelFactory(NioServerSocketChannelFactory serverSocketChannelFactory)
serverSocketChannelFactory
- the serverSocketChannelFactory to setpublic void closeChannel(NioChannel channel)
channel
- the channel to be closedpublic NioEndpoint.SendfileData getSendfileData()
NioEndpoint.SendfileData
from the pool, else nullCopyright © 2015 JBoss by Red Hat. All rights reserved.