Package io.undertow.protocols.ajp
Class AjpClientChannel
java.lang.Object
io.undertow.server.protocol.framed.AbstractFramedChannel<AjpClientChannel,AbstractAjpClientStreamSourceChannel,AbstractAjpClientStreamSinkChannel>
io.undertow.protocols.ajp.AjpClientChannel
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,InterruptibleChannel,org.xnio.channels.BoundChannel,org.xnio.channels.CloseableChannel,org.xnio.channels.Configurable,org.xnio.channels.ConnectedChannel
public class AjpClientChannel
extends AbstractFramedChannel<AjpClientChannel,AbstractAjpClientStreamSourceChannel,AbstractAjpClientStreamSinkChannel>
AJP client side channel.
- Author:
- Stuart Douglas
-
Field Summary
Fields inherited from interface org.xnio.channels.Configurable
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionAjpClientChannel(org.xnio.StreamConnection connectedStreamChannel, ByteBufferPool bufferPool, org.xnio.OptionMap settings) Create a newAbstractFramedChannel8 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidMethod that is called when the channel is being forcibly closed, and all sub stream sink/source channels should also be forcibly closed.protected AbstractAjpClientStreamSourceChannelcreateChannel(FrameHeaderData frameHeaderData, PooledByteBuffer frameData) Method that creates the actual stream source channel implementation that is in use.protected Collection<AbstractFramedStreamSourceChannel<AjpClientChannel,AbstractAjpClientStreamSourceChannel, AbstractAjpClientStreamSinkChannel>> protected org.xnio.OptionMapprotected voidMethod that is invoked when then write side of a channel is broken.protected voidMethod that is invoked when the read side of the channel is broken.protected booleanReturns true if the protocol specific final frame has been received.protected booleanbooleanisOpen()protected voidMethod than is invoked when read() returns -1.protected FrameHeaderDataparseFrame(ByteBuffer data) Attempts to parse an incoming frame header from the data in the buffer.protected voidvoidsendPing(ClientConnection.PingListener pingListener, long timeout, TimeUnit timeUnit) sendRequest(HttpString method, String path, HttpString protocol, HeaderMap headers, Attachable attachable, org.xnio.ChannelListener<AjpClientRequestClientStreamSinkChannel> finishListener) Methods inherited from class io.undertow.server.protocol.framed.AbstractFramedChannel
addCloseTask, close, createIdleTimeoutChannel, flush, flushSenders, getBufferPool, getCloseSetter, getDestinationAddress, getFramePriority, getIdleTimeout, getIoThread, getLocalAddress, getLocalAddress, getOption, getPeerAddress, getPeerAddress, getReceiveSetter, getSourceAddress, getUnderlyingConnection, getWorker, isReadsBroken, isReceivesResumed, isRequireExplicitFlush, isWritesBroken, markReadsBroken, markWritesBroken, queueFrame, receive, resumeReceives, setIdleTimeout, setOption, setRequireExplicitFlush, supportsOption, suspendReceives, toString, writeExceptionHandler
-
Constructor Details
-
AjpClientChannel
public AjpClientChannel(org.xnio.StreamConnection connectedStreamChannel, ByteBufferPool bufferPool, org.xnio.OptionMap settings) Create a newAbstractFramedChannel8- Parameters:
connectedStreamChannel- TheConnectedStreamChannelover which the WebSocket Frames should get send and received. Be aware that it already must be "upgraded".bufferPool- ThePoolwhich will be used to acquireByteBuffer's from.
-
-
Method Details
-
createChannel
protected AbstractAjpClientStreamSourceChannel createChannel(FrameHeaderData frameHeaderData, PooledByteBuffer frameData) throws IOException Description copied from class:AbstractFramedChannelMethod that creates the actual stream source channel implementation that is in use.- Specified by:
createChannelin classAbstractFramedChannel<AjpClientChannel,AbstractAjpClientStreamSourceChannel, AbstractAjpClientStreamSinkChannel> - Parameters:
frameHeaderData- The header data, as returned byAbstractFramedChannel.parseFrame(java.nio.ByteBuffer)frameData- Any additional data for the frame that has already been read. This may not be the complete frame contents- Returns:
- A new stream source channel
- Throws:
IOException
-
parseFrame
Description copied from class:AbstractFramedChannelAttempts to parse an incoming frame header from the data in the buffer.- Specified by:
parseFramein classAbstractFramedChannel<AjpClientChannel,AbstractAjpClientStreamSourceChannel, AbstractAjpClientStreamSinkChannel> - Parameters:
data- The data that has been read from the channel- Returns:
- The frame header data, or
nullif the data was incomplete - Throws:
IOException- If the data could not be parsed.
-
sendRequest
public AjpClientRequestClientStreamSinkChannel sendRequest(HttpString method, String path, HttpString protocol, HeaderMap headers, Attachable attachable, org.xnio.ChannelListener<AjpClientRequestClientStreamSinkChannel> finishListener) -
isLastFrameReceived
protected boolean isLastFrameReceived()Description copied from class:AbstractFramedChannelReturns true if the protocol specific final frame has been received.- Specified by:
isLastFrameReceivedin classAbstractFramedChannel<AjpClientChannel,AbstractAjpClientStreamSourceChannel, AbstractAjpClientStreamSinkChannel> - Returns:
trueIf the last frame has been received
-
isLastFrameSent
protected boolean isLastFrameSent()- Specified by:
isLastFrameSentin classAbstractFramedChannel<AjpClientChannel,AbstractAjpClientStreamSourceChannel, AbstractAjpClientStreamSinkChannel> - Returns:
trueIf the last frame has been sent
-
lastDataRead
protected void lastDataRead()Description copied from class:AbstractFramedChannelMethod than is invoked when read() returns -1. -
handleBrokenSourceChannel
Description copied from class:AbstractFramedChannelMethod that is invoked when the read side of the channel is broken. This generally happens on a protocol error. -
handleBrokenSinkChannel
Description copied from class:AbstractFramedChannelMethod that is invoked when then write side of a channel is broken. This generally happens on a protocol error. -
closeSubChannels
protected void closeSubChannels()Description copied from class:AbstractFramedChannelMethod that is called when the channel is being forcibly closed, and all sub stream sink/source channels should also be forcibly closed. -
getReceivers
-
getSettings
protected org.xnio.OptionMap getSettings() -
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceChannel- Overrides:
isOpenin classAbstractFramedChannel<AjpClientChannel,AbstractAjpClientStreamSourceChannel, AbstractAjpClientStreamSinkChannel>
-
recalculateHeldFrames
-
sendPing
-