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.SocketWrapperBaseSocketWrapperBase.BlockingMode, SocketWrapperBase.CompletionCheck, SocketWrapperBase.CompletionHandlerCall, SocketWrapperBase.CompletionState, SocketWrapperBase.OperationState<A>, SocketWrapperBase.VectoredIOCompletionHandler<A>
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.tomcat.util.net.SocketWrapperBasebufferedWriteSize, closed, COMPLETE_READ, COMPLETE_READ_WITH_COMPLETION, COMPLETE_WRITE, COMPLETE_WRITE_WITH_COMPLETION, localAddr, localName, localPort, nonBlockingWriteBuffer, previousIOException, READ_DATA, readOperation, readPending, remoteAddr, remoteHost, remotePort, sm, socketBufferHandler, writeOperation, writePending
 
- 
 - 
Constructor SummaryConstructors Constructor Description AprSocketWrapper(java.lang.Long socket, AprEndpoint endpoint)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 voiddoClose()Perform the actual close.protected voiddoWrite(boolean block, java.nio.ByteBuffer from)Write the contents of the ByteBuffer to the socket.protected booleanflushNonBlocking()Writes as much data as possible from any that remains in the buffers.booleangetBlockingStatus()java.util.concurrent.locks.LockgetBlockingStatusReadLock()java.util.concurrent.locks.ReentrantReadWriteLock.WriteLockgetBlockingStatusWriteLock()SSLSupportgetSslSupport(java.lang.String clientCertProvider)booleanisReadyForRead()protected <A> SocketWrapperBase.OperationState<A>newOperationState(boolean read, java.nio.ByteBuffer[] buffers, int offset, int length, SocketWrapperBase.BlockingMode block, long timeout, java.util.concurrent.TimeUnit unit, A attachment, SocketWrapperBase.CompletionCheck check, java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler, java.util.concurrent.Semaphore semaphore, SocketWrapperBase.VectoredIOCompletionHandler<A> completion)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)voidsetBlockingStatus(boolean blockingStatus)- 
Methods inherited from class org.apache.tomcat.util.net.SocketWrapperBaseawaitReadComplete, awaitWriteComplete, buffersArrayHasRemaining, canWrite, checkError, close, decrementKeepAlive, doWrite, execute, flush, flushBlocking, getCurrentProcessor, getEndpoint, getError, getLocalAddr, getLocalName, getLocalPort, getNegotiatedProtocol, getReadTimeout, getRemoteAddr, getRemoteHost, getRemotePort, getSocket, getSocketBufferHandler, getWriteTimeout, hasAsyncIO, hasDataToRead, hasDataToWrite, hasPerOperationTimeout, isClosed, isReadPending, isReadyForWrite, isSecure, isUpgraded, isWritePending, needSemaphores, populateReadBuffer, populateReadBuffer, processSocket, read, read, read, reset, setCurrentProcessor, setError, setKeepAliveLeft, setNegotiatedProtocol, setReadTimeout, setSecure, setUpgraded, setWriteTimeout, takeCurrentProcessor, toString, transfer, transfer, unRead, vectoredOperation, write, write, write, write, write, writeBlocking, writeBlocking, writeNonBlocking, writeNonBlocking, writeNonBlockingInternal
 
- 
 
- 
- 
- 
Constructor Detail- 
AprSocketWrapperpublic AprSocketWrapper(java.lang.Long socket, AprEndpoint endpoint)
 
- 
 - 
Method Detail- 
getBlockingStatuspublic boolean getBlockingStatus() 
 - 
setBlockingStatuspublic void setBlockingStatus(boolean blockingStatus) 
 - 
getBlockingStatusReadLockpublic java.util.concurrent.locks.Lock getBlockingStatusReadLock() 
 - 
getBlockingStatusWriteLockpublic java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock getBlockingStatusWriteLock() 
 - 
readpublic int read(boolean block, byte[] b, int off, int len) throws java.io.IOException- Specified by:
- readin class- SocketWrapperBase<java.lang.Long>
- Throws:
- java.io.IOException
 
 - 
readpublic int read(boolean block, java.nio.ByteBuffer to) throws java.io.IOException- Specified by:
- readin class- SocketWrapperBase<java.lang.Long>
- Throws:
- java.io.IOException
 
 - 
isReadyForReadpublic boolean isReadyForRead() throws java.io.IOException- Specified by:
- isReadyForReadin class- SocketWrapperBase<java.lang.Long>
- Throws:
- java.io.IOException
 
 - 
doCloseprotected void doClose() Description copied from class:SocketWrapperBasePerform the actual close. The closed atomic boolean guarantees this will be called only once per wrapper.- Specified by:
- doClosein class- SocketWrapperBase<java.lang.Long>
 
 - 
flushNonBlockingprotected boolean flushNonBlocking() throws java.io.IOExceptionDescription copied from class:SocketWrapperBaseWrites as much data as possible from any that remains in the buffers.- Specified by:
- flushNonBlockingin class- SocketWrapperBase<java.lang.Long>
- Returns:
- trueif data remains to be flushed after this method completes, otherwise- false.
- Throws:
- java.io.IOException- If an IO error occurs during the write
 
 - 
doWriteprotected 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 class- SocketWrapperBase<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
 
 - 
registerReadInterestpublic void registerReadInterest() - Specified by:
- registerReadInterestin class- SocketWrapperBase<java.lang.Long>
 
 - 
registerWriteInterestpublic void registerWriteInterest() - Specified by:
- registerWriteInterestin class- SocketWrapperBase<java.lang.Long>
 
 - 
createSendfileDatapublic SendfileDataBase createSendfileData(java.lang.String filename, long pos, long length) - Specified by:
- createSendfileDatain class- SocketWrapperBase<java.lang.Long>
 
 - 
processSendfilepublic 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 class- SocketWrapperBase<java.lang.Long>
- Parameters:
- sendfileData- Data representing the file to send
- Returns:
- The state of the sendfile process after the first write.
 
 - 
populateRemoteAddrprotected void populateRemoteAddr() - Specified by:
- populateRemoteAddrin class- SocketWrapperBase<java.lang.Long>
 
 - 
populateRemoteHostprotected void populateRemoteHost() - Specified by:
- populateRemoteHostin class- SocketWrapperBase<java.lang.Long>
 
 - 
populateRemotePortprotected void populateRemotePort() - Specified by:
- populateRemotePortin class- SocketWrapperBase<java.lang.Long>
 
 - 
populateLocalNameprotected void populateLocalName() - Specified by:
- populateLocalNamein class- SocketWrapperBase<java.lang.Long>
 
 - 
populateLocalAddrprotected void populateLocalAddr() - Specified by:
- populateLocalAddrin class- SocketWrapperBase<java.lang.Long>
 
 - 
populateLocalPortprotected void populateLocalPort() - Specified by:
- populateLocalPortin class- SocketWrapperBase<java.lang.Long>
 
 - 
getSslSupportpublic SSLSupport getSslSupport(java.lang.String clientCertProvider) - Specified by:
- getSslSupportin class- SocketWrapperBase<java.lang.Long>
 
 - 
doClientAuthpublic 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 class- SocketWrapperBase<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
 
 - 
setAppReadBufHandlerpublic void setAppReadBufHandler(ApplicationBufferHandler handler) - Specified by:
- setAppReadBufHandlerin class- SocketWrapperBase<java.lang.Long>
 
 - 
newOperationStateprotected <A> SocketWrapperBase.OperationState<A> newOperationState(boolean read, java.nio.ByteBuffer[] buffers, int offset, int length, SocketWrapperBase.BlockingMode block, long timeout, java.util.concurrent.TimeUnit unit, A attachment, SocketWrapperBase.CompletionCheck check, java.nio.channels.CompletionHandler<java.lang.Long,? super A> handler, java.util.concurrent.Semaphore semaphore, SocketWrapperBase.VectoredIOCompletionHandler<A> completion) - Specified by:
- newOperationStatein class- SocketWrapperBase<java.lang.Long>
 
 
- 
 
-