public class JIoEndpoint extends AbstractEndpoint
| 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.
|
protected class |
JIoEndpoint.AsyncTimeout
Async timeout thread
|
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.BindState| Modifier and Type | Field and Description |
|---|---|
protected JIoEndpoint.Handler |
handler
Handling of accepted sockets.
|
protected ServerSocket |
serverSocket
Associated server socket.
|
protected ServerSocketFactory |
serverSocketFactory
Server socket factory.
|
protected ConcurrentLinkedQueue<SocketWrapper<Socket>> |
waitingRequests |
acceptors, acceptorThreadCount, acceptorThreadPriority, attributes, internalExecutor, paused, running, sm, socketProperties, threadPriority| 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.
|
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(Socket socket)
Process a new connection from a new client.
|
boolean |
processSocketAsync(SocketWrapper<Socket> socket,
SocketStatus status)
Process an existing async connection.
|
void |
setHandler(JIoEndpoint.Handler handler) |
void |
setServerSocketFactory(ServerSocketFactory factory) |
protected boolean |
setSocketOptions(Socket socket)
Configure the socket.
|
void |
startInternal() |
void |
stopInternal() |
void |
unbind()
Deallocate APR memory pools, and close server socket.
|
adjustRelativePath, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, getAcceptorThreadCount, getAcceptorThreadPriority, getAddress, getAlgorithm, getAllowUnsafeLegacyRenegotiation, getAttribute, getBacklog, getBindOnInit, getCiphers, getCiphersArray, getClientAuth, getConnectionCount, getCrlFile, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getExecutor, getExecutorTerminationTimeoutMillis, getKeepAliveTimeout, getKeyAlias, getKeyPass, getKeystoreFile, getKeystorePass, getKeystoreProvider, getKeystoreType, getMaxConnections, getMaxHeaderCount, getMaxKeepAliveRequests, getMaxThreads, getMaxThreadsExecutor, getMinSpareThreads, getName, getPort, getProperty, getSessionCacheSize, getSessionTimeout, getSocketProperties, getSoLinger, getSoTimeout, getSslEnabledProtocolsArray, getSslProtocol, getTcpNoDelay, getThreadPriority, getTrustManagerClassName, getTrustMaxCertLength, getTruststoreAlgorithm, getTruststoreFile, getTruststorePass, getTruststoreProvider, getTruststoreType, handleExceptionWithDelay, init, initializeConnectionLatch, isPaused, isRunning, isSSLEnabled, pause, releaseConnectionLatch, resume, setAcceptorThreadCount, setAcceptorThreadPriority, setAddress, setAlgorithm, setAllowUnsafeLegacyRenegotiation, 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, shutdownExecutor, start, startAcceptorThreads, stop, unlockAcceptprotected ServerSocket serverSocket
protected JIoEndpoint.Handler handler
protected ServerSocketFactory serverSocketFactory
protected ConcurrentLinkedQueue<SocketWrapper<Socket>> waitingRequests
public void setHandler(JIoEndpoint.Handler handler)
public JIoEndpoint.Handler getHandler()
public void setServerSocketFactory(ServerSocketFactory factory)
public ServerSocketFactory getServerSocketFactory()
public int getLocalPort()
getLocalPort in class AbstractEndpointpublic boolean getUseSendfile()
getUseSendfile in class AbstractEndpointpublic boolean getUseComet()
getUseComet in class AbstractEndpointpublic boolean getUseCometTimeout()
getUseCometTimeout in class AbstractEndpointpublic boolean getDeferAccept()
getDeferAccept in class AbstractEndpointpublic boolean getUsePolling()
getUsePolling in class AbstractEndpointpublic void bind()
throws Exception
bind in class AbstractEndpointExceptionpublic void startInternal()
throws Exception
startInternal in class AbstractEndpointExceptionpublic void stopInternal()
stopInternal in class AbstractEndpointpublic void unbind()
throws Exception
unbind in class AbstractEndpointExceptionprotected AbstractEndpoint.Acceptor createAcceptor()
AbstractEndpointcreateAcceptor in class AbstractEndpointprotected boolean setSocketOptions(Socket socket)
protected boolean processSocket(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 boolean processSocketAsync(SocketWrapper<Socket> socket, SocketStatus status)
socket - The socket associated with the client.status - Only OPEN and TIMEOUT are used. The others are used for
Comet requests that are not supported by the BIO (JIO)
Connector.true if the socket is passed to the
executor, false if something went wrong.
Returning false is an indication to close
the socket immediately.protected Log getLog()
getLog in class AbstractEndpointCopyright © 2000-2013 Apache Software Foundation. All Rights Reserved.