Top Inners Fields Constructors Methods
io.undertow.client.ajp

pack-priv Class AjpClientConnection

extends AbstractAttachable
implements Closeable, ClientConnection
Class Inheritance
All Implemented Interfaces
io.undertow.client.ClientConnection, java.nio.channels.Channel, java.io.Closeable, java.lang.AutoCloseable
Static Imports
io.undertow.util.Headers.CLOSE, .Headers.CONNECTION, .Headers.CONTENT_LENGTH, .Headers.TRANSFER_ENCODING, .Headers.UPGRADE, org.xnio.Bits.anyAreSet, .IoUtils.safeClose

Author
David M. Lloyd

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private final ByteBufferPool
private final ClientStatistics
private static final int
private static final int
private final List<ChannelListener<ClientConnection>>
private final ChannelListener.SimpleSetter<AjpClientConnection>
private final AjpClientChannel
private AjpClientExchange
private static final Logger
private final OptionMap
private final Deque<AjpClientExchange>
public final ChannelListener<AjpClientRequestClientStreamSinkChannel>
public final ChannelListener<AjpClientResponseStreamSourceChannel>
private int
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
pack-priv
AjpClientConnection(final AjpClientChannel connection, final OptionMap options, final ByteBufferPool bufferPool, ClientStatistics clientStatistics)

Method Summary

Modifier and TypeMethod and Description
public void
addCloseListener(ChannelListener<ClientConnection>
The close listener
listener
)

Implements io.undertow.client.ClientConnection.addCloseListener.

Adds a close listener, than will be invoked with the connection is closed

public void
close()

Implements java.io.Closeable.close, java.nio.channels.Channel.close.

Closes this stream and releases any system resources associated with it.

public ByteBufferPool
public ChannelListener.Setter<? extends AjpClientConnection>
public XnioIoThread
public SocketAddress
public <A extends SocketAddress> A
public <T> T
public SocketAddress
public <A extends SocketAddress> A
public ClientStatistics
public XnioWorker
private void
private void
private void
public boolean
public boolean
isOpen()

Implements io.undertow.client.ClientConnection.isOpen.

Tells whether or not this channel is open.

public boolean
public boolean
public boolean
public boolean
public StreamConnection
performUpgrade()

Implements io.undertow.client.ClientConnection.performUpgrade.

Upgrade the connection, if the underlying protocol supports it.

public void
public void
requestDone()

Notification that the current request is finished

public void
public void
sendRequest(final ClientRequest
The request to send.
request
,
final ClientCallback<ClientExchange> clientCallback)

Implements io.undertow.client.ClientConnection.sendRequest.

Sends a client request.

public <T> T
public boolean
Inherited from io.undertow.util.AbstractAttachable:
addToAttachmentListcreateAttachmentMapgetAttachmentgetAttachmentListputAttachmentremoveAttachment

Field Detail

bufferPoolback to summary
private final ByteBufferPool bufferPool
clientStatisticsback to summary
private final ClientStatistics clientStatistics
CLOSE_REQback to summary
private static final int CLOSE_REQ
CLOSEDback to summary
private static final int CLOSED
closeListenersback to summary
private final List<ChannelListener<ClientConnection>> closeListeners
closeSetterback to summary
private final ChannelListener.SimpleSetter<AjpClientConnection> closeSetter
connectionback to summary
private final AjpClientChannel connection
currentRequestback to summary
private AjpClientExchange currentRequest
logback to summary
private static final Logger log
optionsback to summary
private final OptionMap options
pendingQueueback to summary
private final Deque<AjpClientExchange> pendingQueue
requestFinishListenerback to summary
public final ChannelListener<AjpClientRequestClientStreamSinkChannel> requestFinishListener
responseFinishedListenerback to summary
public final ChannelListener<AjpClientResponseStreamSourceChannel> responseFinishedListener
stateback to summary
private int state
UPGRADE_REQUESTEDback to summary
private static final int UPGRADE_REQUESTED
UPGRADEDback to summary
private static final int UPGRADED

Constructor Detail

AjpClientConnectionback to summary
pack-priv AjpClientConnection(final AjpClientChannel connection, final OptionMap options, final ByteBufferPool bufferPool, ClientStatistics clientStatistics)

Method Detail

addCloseListenerback to summary
public void addCloseListener(ChannelListener<ClientConnection> listener)

Implements io.undertow.client.ClientConnection.addCloseListener.

Doc from io.undertow.client.ClientConnection.addCloseListener.

Adds a close listener, than will be invoked with the connection is closed

Parameters
listener:ChannelListener<ClientConnection>

The close listener

Annotations
@Override
closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close, java.nio.channels.Channel.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Exceptions
IOException:
if an I/O error occurs
getBufferPoolback to summary
public ByteBufferPool getBufferPool()

Implements io.undertow.client.ClientConnection.getBufferPool.

Returns:ByteBufferPool

Doc from io.undertow.client.ClientConnection.getBufferPool.

The buffer pool used by the client

Annotations
@Override
getCloseSetterback to summary
public ChannelListener.Setter<? extends AjpClientConnection> getCloseSetter()

Implements io.undertow.client.ClientConnection.getCloseSetter.

Annotations
@Override
getIoThreadback to summary
public XnioIoThread getIoThread()

Implements io.undertow.client.ClientConnection.getIoThread.

Annotations
@Override
getLocalAddressback to summary
public SocketAddress getLocalAddress()

Implements io.undertow.client.ClientConnection.getLocalAddress.

Annotations
@Override
getLocalAddressback to summary
public <A extends SocketAddress> A getLocalAddress(Class<A> type)

Implements io.undertow.client.ClientConnection.getLocalAddress.

Annotations
@Override
getOptionback to summary
public <T> T getOption(Option<T> option) throws IOException

Implements io.undertow.client.ClientConnection.getOption.

Annotations
@Override
getPeerAddressback to summary
public SocketAddress getPeerAddress()

Implements io.undertow.client.ClientConnection.getPeerAddress.

Annotations
@Override
getPeerAddressback to summary
public <A extends SocketAddress> A getPeerAddress(Class<A> type)

Implements io.undertow.client.ClientConnection.getPeerAddress.

Annotations
@Override
getStatisticsback to summary
public ClientStatistics getStatistics()

Implements io.undertow.client.ClientConnection.getStatistics.

Returns:ClientStatistics

Doc from io.undertow.client.ClientConnection.getStatistics.

the statistics information, or null if statistics are not supported or disabled

Annotations
@Override
getWorkerback to summary
public XnioWorker getWorker()

Implements io.undertow.client.ClientConnection.getWorker.

Annotations
@Override
handleErrorback to summary
private void handleError(IOException exception)
handleFailedFlushback to summary
private void handleFailedFlush(AjpClientRequestClientStreamSinkChannel sinkChannel)
initiateRequestback to summary
private void initiateRequest(AjpClientExchange AjpClientExchange)
isMultiplexingSupportedback to summary
public boolean isMultiplexingSupported()

Implements io.undertow.client.ClientConnection.isMultiplexingSupported.

Returns:boolean

Doc from io.undertow.client.ClientConnection.isMultiplexingSupported.

true if this client supports multiplexing

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Implements io.undertow.client.ClientConnection.isOpen.

Doc from java.nio.channels.Channel.isOpen.

Tells whether or not this channel is open.

Returns:boolean

true if, and only if, this channel is open

Annotations
@Override
isPingSupportedback to summary
public boolean isPingSupported()

Overrides default io.undertow.client.ClientConnection.isPingSupported.

Returns:boolean

Doc from io.undertow.client.ClientConnection.isPingSupported.

true if the underlying protocol supports sending a ping

Annotations
@Override
isPushSupportedback to summary
public boolean isPushSupported()

Implements io.undertow.client.ClientConnection.isPushSupported.

Returns:boolean

Doc from io.undertow.client.ClientConnection.isPushSupported.

true if this connection support server push

Annotations
@Override
isUpgradedback to summary
public boolean isUpgraded()

Implements io.undertow.client.ClientConnection.isUpgraded.

Annotations
@Override
isUpgradeSupportedback to summary
public boolean isUpgradeSupported()

Implements io.undertow.client.ClientConnection.isUpgradeSupported.

Annotations
@Override
performUpgradeback to summary
public StreamConnection performUpgrade() throws IOException

Implements io.undertow.client.ClientConnection.performUpgrade.

Doc from io.undertow.client.ClientConnection.performUpgrade.

Upgrade the connection, if the underlying protocol supports it. This should only be called after an upgrade request has been submitted and the target server has accepted the upgrade.

Returns:StreamConnection

The resulting StreamConnection

requestCloseback to summary
public void requestClose()
requestDoneback to summary
public void requestDone()

Notification that the current request is finished

sendPingback to summary
public void sendPing(ClientConnection.PingListener listener, long timeout, TimeUnit timeUnit)

Overrides default io.undertow.client.ClientConnection.sendPing.

Annotations
@Override
sendRequestback to summary
public void sendRequest(final ClientRequest request, final ClientCallback<ClientExchange> clientCallback)

Implements io.undertow.client.ClientConnection.sendRequest.

Doc from io.undertow.client.ClientConnection.sendRequest.

Sends a client request. The request object should not be modified after it has been submitted to the connection.

Request objects can be queued. Once the request is in a state that it is ready to be sent the clientCallback is invoked to provide the caller with the ClientExchange

If isMultiplexingSupported() returns true then multiple requests may be active at the same time, and a later request may complete before an earlier one.

Note that the request header may not be written out until after the callback has been invoked. This allows the client to write out a header with a gathering write if the request contains content.

Parameters
request:ClientRequest

The request to send.

Annotations
@Override
setOptionback to summary
public <T> T setOption(Option<T> option, T value) throws IllegalArgumentException, IOException

Implements io.undertow.client.ClientConnection.setOption.

Annotations
@Override
supportsOptionback to summary
public boolean supportsOption(Option<?> option)

Implements io.undertow.client.ClientConnection.supportsOption.

Annotations
@Override
io.undertow.client.ajp back to summary

pack-priv Class AjpClientConnection.ClientReceiveListener

extends Object
implements ChannelListener<AjpClientChannel>
Class Inheritance
  • java.lang.Object
  • io.undertow.client.ajp.AjpClientConnection.ClientReceiveListener
All Implemented Interfaces
org.xnio.ChannelListener, java.util.EventListener

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
handleEvent(AjpClientChannel
the channel event
channel
)

Implements org.xnio.ChannelListener.handleEvent.

Handle the event on this channel.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ClientReceiveListenerback to summary
pack-priv ClientReceiveListener()

Method Detail

handleEventback to summary
public void handleEvent(AjpClientChannel channel)

Implements org.xnio.ChannelListener.handleEvent.

Doc from org.xnio.ChannelListener.handleEvent.

Handle the event on this channel.

Parameters
channel:AjpClientChannel

the channel event