public class JIoEndpoint extends AbstractEndpoint<java.net.Socket>
Modifier and Type | Class and Description |
---|---|
protected class |
JIoEndpoint.Acceptor
The background thread that listens for incoming TCP/IP connections and
hands them off to an appropriate processor.
|
static interface |
JIoEndpoint.Handler
Bare bones interface used for socket processing.
|
protected class |
JIoEndpoint.SocketProcessor
This class is the equivalent of the Worker, but will simply use in an
external Executor thread pool.
|
AbstractEndpoint.AsyncTimeout, AbstractEndpoint.BindState
Modifier and Type | Field and Description |
---|---|
protected JIoEndpoint.Handler |
handler
Handling of accepted sockets.
|
protected java.net.ServerSocket |
serverSocket
Associated server socket.
|
protected ServerSocketFactory |
serverSocketFactory
Server socket factory.
|
acceptors, acceptorThreadCount, acceptorThreadPriority, attributes, DEFAULT_CIPHERS, internalExecutor, paused, running, sm, socketProperties, threadPriority, waitingRequests
Constructor and Description |
---|
JIoEndpoint() |
Modifier and Type | Method and Description |
---|---|
void |
bind() |
protected AbstractEndpoint.Acceptor |
createAcceptor()
Hook to allow Endpoints to provide a specific Acceptor implementation.
|
java.lang.String[] |
getCiphersUsed() |
boolean |
getDeferAccept() |
JIoEndpoint.Handler |
getHandler() |
int |
getLocalPort()
Port in use.
|
protected Log |
getLog() |
ServerSocketFactory |
getServerSocketFactory() |
boolean |
getUseComet() |
boolean |
getUseCometTimeout() |
boolean |
getUsePolling() |
boolean |
getUseSendfile() |
protected boolean |
processSocket(java.net.Socket socket)
Process a new connection from a new client.
|
void |
processSocket(SocketWrapper<java.net.Socket> socket,
SocketStatus status,
boolean dispatch)
Process the given SocketWrapper with the given status.
|
void |
setHandler(JIoEndpoint.Handler handler) |
void |
setServerSocketFactory(ServerSocketFactory factory) |
protected boolean |
setSocketOptions(java.net.Socket socket)
Configure the socket.
|
void |
startInternal() |
void |
stopInternal() |
void |
unbind()
Deallocate APR memory pools, and close server socket.
|
configureUseServerCipherSuitesOrder, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, executeNonBlockingDispatches, getAcceptorThreadCount, getAcceptorThreadPriority, getAddress, getAlgorithm, getAllowUnsafeLegacyRenegotiation, getAsyncTimeout, getAttribute, getBacklog, getBindOnInit, getCiphers, getClientAuth, getConnectionCount, getCrlFile, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getExecutor, getExecutorTerminationTimeoutMillis, getKeepAliveTimeout, getKeyAlias, getKeyPass, getKeystoreFile, getKeystorePass, getKeystoreProvider, getKeystoreType, getMaxConnections, getMaxHeaderCount, getMaxKeepAliveRequests, getMaxThreads, getMaxThreadsInternal, getMaxThreadsWithExecutor, getMinSpareThreads, getName, getPort, getProperty, getSessionCacheSize, getSessionTimeout, getSocketProperties, getSoLinger, getSoTimeout, getSslEnabledProtocolsArray, getSslProtocol, getTcpNoDelay, getThreadPriority, getTrustManagerClassName, getTrustMaxCertLength, getTruststoreAlgorithm, getTruststoreFile, getTruststorePass, getTruststoreProvider, getTruststoreType, getUseServerCipherSuitesOrder, handleExceptionWithDelay, init, initializeConnectionLatch, isPaused, isRunning, isSSLEnabled, pause, releaseConnectionLatch, removeWaitingRequest, resume, setAcceptorThreadCount, setAcceptorThreadPriority, setAddress, setAlgorithm, setAllowUnsafeLegacyRenegotiation, setAsyncTimeout, setAttribute, setBacklog, setBindOnInit, setCiphers, setClientAuth, setCrlFile, setDaemon, setExecutor, setExecutorTerminationTimeoutMillis, setKeepAliveTimeout, setKeyAlias, setKeyPass, setKeystoreFile, setKeystorePass, setKeystoreProvider, setKeystoreType, setMaxConnections, setMaxHeaderCount, setMaxKeepAliveRequests, setMaxThreads, setMinSpareThreads, setName, setPort, setProperty, setSessionCacheSize, setSessionTimeout, setSoLinger, setSoTimeout, setSSLEnabled, setSslEnabledProtocols, setSslProtocol, setTcpNoDelay, setThreadPriority, setTrustManagerClassName, setTrustMaxCertLength, setTruststoreAlgorithm, setTruststoreFile, setTruststorePass, setTruststoreProvider, setTruststoreType, setUseServerCipherSuitesOrder, shutdownExecutor, start, startAcceptorThreads, stop, testServerCipherSuitesOrderSupport, unlockAccept
protected java.net.ServerSocket serverSocket
protected JIoEndpoint.Handler handler
protected ServerSocketFactory serverSocketFactory
public void setHandler(JIoEndpoint.Handler handler)
public JIoEndpoint.Handler getHandler()
public void setServerSocketFactory(ServerSocketFactory factory)
public ServerSocketFactory getServerSocketFactory()
public int getLocalPort()
getLocalPort
in class AbstractEndpoint<java.net.Socket>
public java.lang.String[] getCiphersUsed()
getCiphersUsed
in class AbstractEndpoint<java.net.Socket>
public boolean getUseSendfile()
getUseSendfile
in class AbstractEndpoint<java.net.Socket>
public boolean getUseComet()
getUseComet
in class AbstractEndpoint<java.net.Socket>
public boolean getUseCometTimeout()
getUseCometTimeout
in class AbstractEndpoint<java.net.Socket>
public boolean getDeferAccept()
getDeferAccept
in class AbstractEndpoint<java.net.Socket>
public boolean getUsePolling()
getUsePolling
in class AbstractEndpoint<java.net.Socket>
public void bind() throws java.lang.Exception
bind
in class AbstractEndpoint<java.net.Socket>
java.lang.Exception
public void startInternal() throws java.lang.Exception
startInternal
in class AbstractEndpoint<java.net.Socket>
java.lang.Exception
public void stopInternal()
stopInternal
in class AbstractEndpoint<java.net.Socket>
public void unbind() throws java.lang.Exception
unbind
in class AbstractEndpoint<java.net.Socket>
java.lang.Exception
protected AbstractEndpoint.Acceptor createAcceptor()
AbstractEndpoint
createAcceptor
in class AbstractEndpoint<java.net.Socket>
protected boolean setSocketOptions(java.net.Socket socket)
protected boolean processSocket(java.net.Socket socket)
socket
- The socket associated with the client.true
if the socket is passed to the
executor, false
if something went wrong or
if the endpoint is shutting down. Returning
false
is an indication to close the socket
immediately.public void processSocket(SocketWrapper<java.net.Socket> socket, SocketStatus status, boolean dispatch)
AbstractEndpoint
processSocket
in class AbstractEndpoint<java.net.Socket>
socket
- The socket wrapper to processstatus
- The input status to the processingdispatch
- Should the processing be performed on a new
container threadprotected Log getLog()
getLog
in class AbstractEndpoint<java.net.Socket>
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.