Package org.apache.tomcat.util.net
Class AprEndpoint.AprSocketWrapper
- java.lang.Object
-
- org.apache.tomcat.util.net.SocketWrapperBase<java.lang.Long>
-
- org.apache.tomcat.util.net.AprEndpoint.AprSocketWrapper
-
- Enclosing class:
- AprEndpoint
public static class AprEndpoint.AprSocketWrapper extends SocketWrapperBase<java.lang.Long>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.tomcat.util.net.SocketWrapperBase
SocketWrapperBase.BlockingMode, SocketWrapperBase.CompletionCheck, SocketWrapperBase.CompletionHandlerCall, SocketWrapperBase.CompletionState
-
-
Field Summary
-
Fields inherited from class org.apache.tomcat.util.net.SocketWrapperBase
bufferedWriteSize, COMPLETE_WRITE, COMPLETE_WRITE_WITH_COMPLETION, localAddr, localName, localPort, nonBlockingWriteBuffer, READ_DATA, remoteAddr, remoteHost, remotePort, sm, socketBufferHandler
-
-
Constructor Summary
Constructors Constructor Description AprSocketWrapper(java.lang.Long socket, AprEndpoint endpoint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()SendfileDataBasecreateSendfileData(java.lang.String filename, long pos, long length)voiddoClientAuth(SSLSupport sslSupport)Require the client to perform CLIENT-CERT authentication if it hasn't already done so.protected voiddoWrite(boolean block, java.nio.ByteBuffer from)Write the contents of the ByteBuffer to the socket.SSLSupportgetSslSupport(java.lang.String clientCertProvider)booleanisClosed()booleanisReadyForRead()protected voidpopulateLocalAddr()protected voidpopulateLocalName()protected voidpopulateLocalPort()protected voidpopulateRemoteAddr()protected voidpopulateRemoteHost()protected voidpopulateRemotePort()SendfileStateprocessSendfile(SendfileDataBase sendfileData)Starts the sendfile process.intread(boolean block, byte[] b, int off, int len)intread(boolean block, java.nio.ByteBuffer to)voidregisterReadInterest()voidregisterWriteInterest()voidsetAppReadBufHandler(ApplicationBufferHandler handler)protected voidwriteBlockingDirect(java.nio.ByteBuffer from)Writes directly to the network, bypassing the socket write buffer.protected voidwriteNonBlockingDirect(java.nio.ByteBuffer from)-
Methods inherited from class org.apache.tomcat.util.net.SocketWrapperBase
awaitReadComplete, awaitWriteComplete, canWrite, checkError, decrementKeepAlive, doWrite, execute, flush, flushBlocking, flushNonBlocking, getBlockingStatus, getBlockingStatusReadLock, getBlockingStatusWriteLock, getEndpoint, getError, getLocalAddr, getLocalName, getLocalPort, getNegotiatedProtocol, getReadTimeout, getRemoteAddr, getRemoteHost, getRemotePort, getSocket, getSocketBufferHandler, getWriteTimeout, hasAsyncIO, hasDataToWrite, isReadPending, isReadyForWrite, isSecure, isUpgraded, isWritePending, populateReadBuffer, populateReadBuffer, processSocket, read, read, setBlockingStatus, setError, setKeepAliveLeft, setNegotiatedProtocol, setReadTimeout, setSecure, setUpgraded, setWriteTimeout, toString, transfer, transfer, unRead, write, write, write, write, writeBlocking, writeBlocking, writeNonBlocking, writeNonBlocking, writeNonBlockingInternal
-
-
-
-
Constructor Detail
-
AprSocketWrapper
public AprSocketWrapper(java.lang.Long socket, AprEndpoint endpoint)
-
-
Method Detail
-
read
public int read(boolean block, byte[] b, int off, int len) throws java.io.IOException- Specified by:
readin classSocketWrapperBase<java.lang.Long>- Throws:
java.io.IOException
-
read
public int read(boolean block, java.nio.ByteBuffer to) throws java.io.IOException- Specified by:
readin classSocketWrapperBase<java.lang.Long>- Throws:
java.io.IOException
-
isReadyForRead
public boolean isReadyForRead() throws java.io.IOException- Specified by:
isReadyForReadin classSocketWrapperBase<java.lang.Long>- Throws:
java.io.IOException
-
close
public void close()
- Specified by:
closein classSocketWrapperBase<java.lang.Long>
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin classSocketWrapperBase<java.lang.Long>
-
writeBlockingDirect
protected void writeBlockingDirect(java.nio.ByteBuffer from) throws java.io.IOExceptionDescription copied from class:SocketWrapperBaseWrites directly to the network, bypassing the socket write buffer.- Overrides:
writeBlockingDirectin classSocketWrapperBase<java.lang.Long>- Parameters:
from- The ByteBuffer containing the data to be written- Throws:
java.io.IOException- If an IO error occurs during the write
-
writeNonBlockingDirect
protected void writeNonBlockingDirect(java.nio.ByteBuffer from) throws java.io.IOException- Overrides:
writeNonBlockingDirectin classSocketWrapperBase<java.lang.Long>- Throws:
java.io.IOException
-
doWrite
protected void doWrite(boolean block, java.nio.ByteBuffer from) throws java.io.IOExceptionDescription copied from class:SocketWrapperBaseWrite the contents of the ByteBuffer to the socket. For blocking writes either then entire contents of the buffer will be written or an IOException will be thrown. Partial blocking writes will not occur.- Specified by:
doWritein classSocketWrapperBase<java.lang.Long>- Parameters:
block- Should the write be blocking or not?from- the ByteBuffer containing the data to be written- Throws:
java.io.IOException- If an I/O error such as a timeout occurs during the write
-
registerReadInterest
public void registerReadInterest()
- Specified by:
registerReadInterestin classSocketWrapperBase<java.lang.Long>
-
registerWriteInterest
public void registerWriteInterest()
- Specified by:
registerWriteInterestin classSocketWrapperBase<java.lang.Long>
-
createSendfileData
public SendfileDataBase createSendfileData(java.lang.String filename, long pos, long length)
- Specified by:
createSendfileDatain classSocketWrapperBase<java.lang.Long>
-
processSendfile
public SendfileState processSendfile(SendfileDataBase sendfileData)
Description copied from class:SocketWrapperBaseStarts the sendfile process. It is expected that if the sendfile process does not complete during this call and does not report an error, that the caller will not add the socket to the poller (or equivalent). That is the responsibility of this method.- Specified by:
processSendfilein classSocketWrapperBase<java.lang.Long>- Parameters:
sendfileData- Data representing the file to send- Returns:
- The state of the sendfile process after the first write.
-
populateRemoteAddr
protected void populateRemoteAddr()
- Specified by:
populateRemoteAddrin classSocketWrapperBase<java.lang.Long>
-
populateRemoteHost
protected void populateRemoteHost()
- Specified by:
populateRemoteHostin classSocketWrapperBase<java.lang.Long>
-
populateRemotePort
protected void populateRemotePort()
- Specified by:
populateRemotePortin classSocketWrapperBase<java.lang.Long>
-
populateLocalName
protected void populateLocalName()
- Specified by:
populateLocalNamein classSocketWrapperBase<java.lang.Long>
-
populateLocalAddr
protected void populateLocalAddr()
- Specified by:
populateLocalAddrin classSocketWrapperBase<java.lang.Long>
-
populateLocalPort
protected void populateLocalPort()
- Specified by:
populateLocalPortin classSocketWrapperBase<java.lang.Long>
-
getSslSupport
public SSLSupport getSslSupport(java.lang.String clientCertProvider)
- Specified by:
getSslSupportin classSocketWrapperBase<java.lang.Long>
-
doClientAuth
public void doClientAuth(SSLSupport sslSupport) throws java.io.IOException
Description copied from class:SocketWrapperBaseRequire the client to perform CLIENT-CERT authentication if it hasn't already done so.- Specified by:
doClientAuthin classSocketWrapperBase<java.lang.Long>- Parameters:
sslSupport- The SSL/TLS support instance currently being used by the connection that may need updating after the client authentication- Throws:
java.io.IOException- If authentication is required then there will be I/O with the client and this exception will be thrown if that goes wrong
-
setAppReadBufHandler
public void setAppReadBufHandler(ApplicationBufferHandler handler)
- Specified by:
setAppReadBufHandlerin classSocketWrapperBase<java.lang.Long>
-
-