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 newAbstractFramedChannel
8 -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Method that is called when the channel is being forcibly closed, and all sub stream sink/source channels should also be forcibly closed.protected AbstractAjpClientStreamSourceChannel
createChannel
(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.OptionMap
protected void
Method that is invoked when then write side of a channel is broken.protected void
Method that is invoked when the read side of the channel is broken.protected boolean
Returns true if the protocol specific final frame has been received.protected boolean
boolean
isOpen()
protected void
Method than is invoked when read() returns -1.protected FrameHeaderData
parseFrame
(ByteBuffer data) Attempts to parse an incoming frame header from the data in the buffer.protected void
void
sendPing
(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 newAbstractFramedChannel
8- Parameters:
connectedStreamChannel
- TheConnectedStreamChannel
over which the WebSocket Frames should get send and received. Be aware that it already must be "upgraded".bufferPool
- ThePool
which will be used to acquireByteBuffer
's from.
-
-
Method Details
-
createChannel
protected AbstractAjpClientStreamSourceChannel createChannel(FrameHeaderData frameHeaderData, PooledByteBuffer frameData) throws IOException Description copied from class:AbstractFramedChannel
Method that creates the actual stream source channel implementation that is in use.- Specified by:
createChannel
in 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:AbstractFramedChannel
Attempts to parse an incoming frame header from the data in the buffer.- Specified by:
parseFrame
in classAbstractFramedChannel<AjpClientChannel,
AbstractAjpClientStreamSourceChannel, AbstractAjpClientStreamSinkChannel> - Parameters:
data
- The data that has been read from the channel- Returns:
- The frame header data, or
null
if 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:AbstractFramedChannel
Returns true if the protocol specific final frame has been received.- Specified by:
isLastFrameReceived
in classAbstractFramedChannel<AjpClientChannel,
AbstractAjpClientStreamSourceChannel, AbstractAjpClientStreamSinkChannel> - Returns:
true
If the last frame has been received
-
isLastFrameSent
protected boolean isLastFrameSent()- Specified by:
isLastFrameSent
in classAbstractFramedChannel<AjpClientChannel,
AbstractAjpClientStreamSourceChannel, AbstractAjpClientStreamSinkChannel> - Returns:
true
If the last frame has been sent
-
lastDataRead
protected void lastDataRead()Description copied from class:AbstractFramedChannel
Method than is invoked when read() returns -1. -
handleBrokenSourceChannel
Description copied from class:AbstractFramedChannel
Method that is invoked when the read side of the channel is broken. This generally happens on a protocol error. -
handleBrokenSinkChannel
Description copied from class:AbstractFramedChannel
Method 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:AbstractFramedChannel
Method 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:
isOpen
in interfaceChannel
- Overrides:
isOpen
in classAbstractFramedChannel<AjpClientChannel,
AbstractAjpClientStreamSourceChannel, AbstractAjpClientStreamSinkChannel>
-
recalculateHeldFrames
-
sendPing
-