public abstract class AbstractEndpoint extends Object
AbstractEndpoint
Created on Dec 14, 2011 at 2:58:58 PMModifier and Type | Field and Description |
---|---|
protected int |
acceptorThreadCount
Acceptor thread count.
|
protected InetAddress |
address
Address for the server socket.
|
protected int |
backlog
Allows the server developer to specify the backlog that should be used
for server sockets.
|
protected AtomicInteger |
counter
The number of open connections
|
protected int |
curThreads
Current worker threads count.
|
protected int |
curThreadsBusy
Current worker threads busy count.
|
protected boolean |
daemon
The default is true - the created threads will be in daemon mode.
|
protected static int |
DEFAULT_SO_TIMEOUT
The default socket timeout = 60 sec
|
protected boolean |
deferAccept
Defer accept.
|
protected Executor |
executor
External Executor based thread pool.
|
protected boolean |
initialized
Track the initialization state of the endpoint.
|
protected int |
keepAliveTimeout
Keep-Alive timeout.
|
protected int |
maxConnections
The maximum number of connections
|
protected int |
maxThreads
Maximum amount of worker threads.
|
protected String |
name
Name of the thread pool, which will be used for naming child threads.
|
protected boolean |
paused
Will be set to true whenever the endpoint is paused.
|
protected int |
port
Server socket port.
|
protected boolean |
reuseAddress |
protected boolean |
reverseConnection
Reverse connection.
|
protected boolean |
running
Running state of the endpoint.
|
protected int |
sendfileSize
Size of the sendfile (= concurrent files which can be served).
|
protected int |
sequence
Sequence number used to generate thread names.
|
protected int |
soLinger
Socket linger.
|
protected int |
soReceiveBuffer
Receive buffer.
|
protected int |
soSendBuffer
Send buffer.
|
protected int |
soTimeout
Socket timeout.
|
protected String |
SSLCACertificateFile
SSL CA certificate file.
|
protected String |
SSLCACertificatePath
SSL CA certificate path.
|
protected String |
SSLCARevocationFile
SSL CA revocation file.
|
protected String |
SSLCARevocationPath
SSL CA revocation path.
|
protected String |
SSLCertificateChainFile
SSL certificate chain file.
|
protected String |
SSLCertificateFile
SSL certificate file.
|
protected String |
SSLCertificateKeyFile
SSL certificate key file.
|
protected String |
SSLCipherSuite
SSL cipher suite.
|
protected boolean |
SSLEnabled
SSL engine.
|
protected boolean |
SSLInsecureRenegotiation
SSL allow insecure renegotiation for the the client that does not support
the secure renegotiation.
|
protected String |
SSLPassword
SSL password (if a cert is encrypted, and no password has been provided,
a callback will ask for a password).
|
protected String |
SSLProtocol
SSL protocols.
|
protected String |
SSLVerifyClient
SSL verify client.
|
protected int |
SSLVerifyDepth
SSL verify depth.
|
protected boolean |
tcpNoDelay
Socket TCP no delay.
|
protected ThreadFactory |
threadFactory
The default thread factory
|
protected int |
threadPriority
Priority of the acceptor and poller threads.
|
protected boolean |
useSendfile
Use sendfile for sending static files.
|
Constructor and Description |
---|
AbstractEndpoint() |
Modifier and Type | Method and Description |
---|---|
abstract void |
destroy()
Deallocate the memory pools, and close server socket.
|
int |
getAcceptorThreadCount()
Getter for acceptorThreadCount
|
InetAddress |
getAddress()
Getter for address
|
int |
getBacklog()
Getter for backlog
|
int |
getCurThreads()
Getter for curThreads
|
int |
getCurThreadsBusy()
Getter for curThreadsBusy
|
boolean |
getDaemon()
Getter for daemon
|
boolean |
getDeferAccept()
Getter for deferAccept
|
Executor |
getExecutor()
Getter for executor
|
int |
getKeepAliveTimeout()
Getter for keepAliveTimeout
|
int |
getMaxConnections()
Getter for maxConnections
|
int |
getMaxThreads()
Getter for maxThreads
|
String |
getName()
Getter for name
|
int |
getPort()
Getter for port
|
int |
getSendfileSize()
Getter for sendfileSize
|
int |
getSequence()
Getter for sequence
|
int |
getSoLinger()
Getter for soLinger
|
int |
getSoReceiveBuffer() |
int |
getSoSendBuffer() |
int |
getSoTimeout()
Getter for soTimeout
|
String |
getSSLCACertificateFile()
Getter for sSLCACertificateFile
|
String |
getSSLCACertificatePath()
Getter for sSLCACertificatePath
|
String |
getSSLCARevocationFile()
Getter for sSLCARevocationFile
|
String |
getSSLCARevocationPath()
Getter for sSLCARevocationPath
|
String |
getSSLCertificateChainFile()
Getter for sSLCertificateChainFile
|
String |
getSSLCertificateFile()
Getter for sSLCertificateFile
|
String |
getSSLCertificateKeyFile()
Getter for sSLCertificateKeyFile
|
String |
getSSLCipherSuite()
Getter for sSLCipherSuite
|
boolean |
getSSLEnabled()
Getter for sSLEnabled
|
boolean |
getSSLInsecureRenegotiation()
Getter for sSLInsecureRenegotiation
|
String |
getSSLPassword()
Getter for sSLPassword
|
String |
getSSLProtocol()
Getter for sSLProtocol
|
String |
getSSLVerifyClient()
Getter for sSLVerifyClient
|
int |
getSSLVerifyDepth()
Getter for sSLVerifyDepth
|
boolean |
getTcpNoDelay()
Getter for tcpNoDelay
|
int |
getThreadPriority()
Getter for threadPriority
|
boolean |
getUseSendfile()
Getter for useSendfile
|
abstract void |
init()
Initialize the endpoint
|
boolean |
isInitialized()
Getter for initialized
|
boolean |
isPaused()
Getter for paused
|
boolean |
isReuseAddress()
Getter for reuseAddress
|
boolean |
isReverseConnection()
Getter for reverseConnection
|
boolean |
isRunning()
Getter for running
|
protected Thread |
newThread(Runnable target,
String name,
boolean daemon)
Create a new thread for the specified target
|
void |
pause()
Pause the endpoint, which will make it stop accepting new sockets.
|
void |
resume()
Resume the endpoint, which will make it start accepting new connections
again.
|
void |
setAcceptorThreadCount(int acceptorThreadCount)
Setter for the acceptorThreadCount
|
void |
setAddress(InetAddress address)
Setter for the address
|
void |
setBacklog(int backlog)
Setter for the backlog
|
void |
setCurThreads(int curThreads)
Setter for the curThreads
|
void |
setCurThreadsBusy(int curThreadsBusy)
Setter for the curThreadsBusy
|
void |
setDaemon(boolean daemon)
Setter for the daemon
|
void |
setDeferAccept(boolean deferAccept)
Setter for the deferAccept
|
void |
setExecutor(Executor executor)
Setter for the executor
|
void |
setInitialized(boolean initialized)
Setter for the initialized
|
void |
setKeepAliveTimeout(int keepAliveTimeout)
Setter for the keepAliveTimeout
|
void |
setMaxConnections(int maxConnections)
Setter for the maxConnections
|
void |
setMaxThreads(int maxThreads)
Setter for the maxThreads
|
void |
setName(String name)
Setter for the name
|
void |
setPaused(boolean paused)
Setter for the paused
|
void |
setPort(int port)
Setter for the port
|
void |
setReuseAddress(boolean reuseAddress)
Setter for the reuseAddress
|
void |
setReverseConnection(boolean reverseConnection)
Setter for the reverseConnection
|
void |
setRunning(boolean running)
Setter for the running
|
void |
setSendfileSize(int sendfileSize)
Setter for the sendfileSize
|
void |
setSequence(int sequence)
Setter for the sequence
|
void |
setSoLinger(int soLinger)
Setter for the soLinger
|
void |
setSoReceiveBuffer(int soReceiveBuffer) |
void |
setSoSendBuffer(int soSendBuffer) |
void |
setSoTimeout(int soTimeout)
Setter for the soTimeout
|
void |
setSSLCACertificateFile(String sSLCACertificateFile)
Setter for the sSLCACertificateFile
|
void |
setSSLCACertificatePath(String sSLCACertificatePath)
Setter for the sSLCACertificatePath
|
void |
setSSLCARevocationFile(String sSLCARevocationFile)
Setter for the sSLCARevocationFile
|
void |
setSSLCARevocationPath(String sSLCARevocationPath)
Setter for the sSLCARevocationPath
|
void |
setSSLCertificateChainFile(String sSLCertificateChainFile)
Setter for the sSLCertificateChainFile
|
void |
setSSLCertificateFile(String sSLCertificateFile)
Setter for the sSLCertificateFile
|
void |
setSSLCertificateKeyFile(String sSLCertificateKeyFile)
Setter for the sSLCertificateKeyFile
|
void |
setSSLCipherSuite(String sSLCipherSuite)
Setter for the sSLCipherSuite
|
void |
setSSLEnabled(boolean sSLEnabled)
Setter for the sSLEnabled
|
void |
setSSLInsecureRenegotiation(boolean sSLInsecureRenegotiation)
Setter for the sSLInsecureRenegotiation
|
void |
setSSLPassword(String sSLPassword)
Setter for the sSLPassword
|
void |
setSSLProtocol(String sSLProtocol)
Setter for the sSLProtocol
|
void |
setSSLVerifyClient(String sSLVerifyClient)
Setter for the sSLVerifyClient
|
void |
setSSLVerifyDepth(int sSLVerifyDepth)
Setter for the sSLVerifyDepth
|
void |
setTcpNoDelay(boolean tcpNoDelay)
Setter for the tcpNoDelay
|
void |
setThreadPriority(int threadPriority)
Setter for the threadPriority
|
void |
setUseSendfile(boolean useSendfile)
Setter for the useSendfile
|
abstract void |
start()
Start the endpoint, creating acceptor, poller and sendfile threads, etc.
|
abstract void |
stop()
Stop the endpoint.
|
protected void |
unlockAccept()
Unlock the server socket accept using a bogus connection.
|
protected static final int DEFAULT_SO_TIMEOUT
protected volatile boolean running
protected volatile boolean paused
protected boolean initialized
protected AtomicInteger counter
protected boolean reuseAddress
protected int curThreadsBusy
protected int curThreads
protected int sequence
protected int acceptorThreadCount
protected Executor executor
protected int maxThreads
protected int maxConnections
protected int threadPriority
protected int sendfileSize
protected int port
protected InetAddress address
protected ThreadFactory threadFactory
protected int backlog
protected boolean tcpNoDelay
protected int soLinger
protected int soTimeout
protected boolean deferAccept
protected int keepAliveTimeout
protected int soReceiveBuffer
protected int soSendBuffer
protected boolean daemon
protected String name
protected boolean useSendfile
protected boolean reverseConnection
protected boolean SSLEnabled
protected String SSLProtocol
protected String SSLPassword
protected String SSLCipherSuite
protected String SSLCertificateFile
protected String SSLCertificateChainFile
protected String SSLCACertificatePath
protected String SSLCACertificateFile
protected String SSLCARevocationPath
protected String SSLCARevocationFile
protected String SSLVerifyClient
protected int SSLVerifyDepth
protected boolean SSLInsecureRenegotiation
protected String SSLCertificateKeyFile
public int getSoReceiveBuffer()
public void setSoReceiveBuffer(int soReceiveBuffer)
public int getSoSendBuffer()
public void setSoSendBuffer(int soSendBuffer)
public abstract void start() throws Exception
Exception
public void pause()
public void resume()
public abstract void stop()
public abstract void destroy() throws Exception
Exception
protected void unlockAccept()
protected Thread newThread(Runnable target, String name, boolean daemon)
target
- name
- daemon
- public boolean isRunning()
public void setRunning(boolean running)
running
- the running to setpublic boolean isPaused()
public void setPaused(boolean paused)
paused
- the paused to setpublic boolean isInitialized()
public void setInitialized(boolean initialized)
initialized
- the initialized to setpublic int getCurThreadsBusy()
public void setCurThreadsBusy(int curThreadsBusy)
curThreadsBusy
- the curThreadsBusy to setpublic int getCurThreads()
public void setCurThreads(int curThreads)
curThreads
- the curThreads to setpublic int getSequence()
public void setSequence(int sequence)
sequence
- the sequence to setpublic Executor getExecutor()
public void setExecutor(Executor executor)
executor
- the executor to setpublic int getMaxThreads()
public void setMaxThreads(int maxThreads)
maxThreads
- the maxThreads to setpublic int getMaxConnections()
public void setMaxConnections(int maxConnections)
maxConnections
- the maxConnections to setpublic int getThreadPriority()
public void setThreadPriority(int threadPriority)
threadPriority
- the threadPriority to setpublic int getSendfileSize()
public void setSendfileSize(int sendfileSize)
sendfileSize
- the sendfileSize to setpublic int getPort()
public void setPort(int port)
port
- the port to setpublic InetAddress getAddress()
public void setAddress(InetAddress address)
address
- the address to setpublic int getBacklog()
public void setBacklog(int backlog)
backlog
- the backlog to setpublic boolean getTcpNoDelay()
public void setTcpNoDelay(boolean tcpNoDelay)
tcpNoDelay
- the tcpNoDelay to setpublic int getSoLinger()
public void setSoLinger(int soLinger)
soLinger
- the soLinger to setpublic int getSoTimeout()
public void setSoTimeout(int soTimeout)
soTimeout
- the soTimeout to setpublic boolean getDeferAccept()
public void setDeferAccept(boolean deferAccept)
deferAccept
- the deferAccept to setpublic int getKeepAliveTimeout()
public void setKeepAliveTimeout(int keepAliveTimeout)
keepAliveTimeout
- the keepAliveTimeout to setpublic boolean getDaemon()
public void setDaemon(boolean daemon)
daemon
- the daemon to setpublic String getName()
public void setName(String name)
name
- the name to setpublic boolean getUseSendfile()
public void setUseSendfile(boolean useSendfile)
useSendfile
- the useSendfile to setpublic boolean isReverseConnection()
public void setReverseConnection(boolean reverseConnection)
reverseConnection
- the reverseConnection to setpublic boolean getSSLEnabled()
public void setSSLEnabled(boolean sSLEnabled)
sSLEnabled
- the sSLEnabled to setpublic String getSSLProtocol()
public void setSSLProtocol(String sSLProtocol)
sSLProtocol
- the sSLProtocol to setpublic String getSSLPassword()
public void setSSLPassword(String sSLPassword)
sSLPassword
- the sSLPassword to setpublic String getSSLCipherSuite()
public void setSSLCipherSuite(String sSLCipherSuite)
sSLCipherSuite
- the sSLCipherSuite to setpublic String getSSLCertificateFile()
public void setSSLCertificateFile(String sSLCertificateFile)
sSLCertificateFile
- the sSLCertificateFile to setpublic String getSSLCertificateChainFile()
public void setSSLCertificateChainFile(String sSLCertificateChainFile)
sSLCertificateChainFile
- the sSLCertificateChainFile to setpublic String getSSLCACertificatePath()
public void setSSLCACertificatePath(String sSLCACertificatePath)
sSLCACertificatePath
- the sSLCACertificatePath to setpublic String getSSLCACertificateFile()
public void setSSLCACertificateFile(String sSLCACertificateFile)
sSLCACertificateFile
- the sSLCACertificateFile to setpublic String getSSLCARevocationPath()
public void setSSLCARevocationPath(String sSLCARevocationPath)
sSLCARevocationPath
- the sSLCARevocationPath to setpublic String getSSLCARevocationFile()
public void setSSLCARevocationFile(String sSLCARevocationFile)
sSLCARevocationFile
- the sSLCARevocationFile to setpublic String getSSLVerifyClient()
public void setSSLVerifyClient(String sSLVerifyClient)
sSLVerifyClient
- the sSLVerifyClient to setpublic int getSSLVerifyDepth()
public void setSSLVerifyDepth(int sSLVerifyDepth)
sSLVerifyDepth
- the sSLVerifyDepth to setpublic boolean getSSLInsecureRenegotiation()
public void setSSLInsecureRenegotiation(boolean sSLInsecureRenegotiation)
sSLInsecureRenegotiation
- the sSLInsecureRenegotiation to setpublic String getSSLCertificateKeyFile()
public void setSSLCertificateKeyFile(String sSLCertificateKeyFile)
sSLCertificateKeyFile
- the sSLCertificateKeyFile to setpublic boolean isReuseAddress()
public void setReuseAddress(boolean reuseAddress)
reuseAddress
- the reuseAddress to setpublic int getAcceptorThreadCount()
public void setAcceptorThreadCount(int acceptorThreadCount)
acceptorThreadCount
- the acceptorThreadCount to setCopyright © 2014 JBoss by Red Hat. All rights reserved.