Top Description Inners Constructors Methods
io.undertow.server.handlers.proxy.mod_cluster

pack-priv Class NodePingUtil

extends Object
Class Inheritance
Imports
java.io.IOException, java.net.InetSocketAddress, .URI, java.util.concurrent.TimeUnit, io.undertow.UndertowLogger, io.undertow.client.ClientCallback, .ClientConnection, .ClientExchange, .ClientRequest, .UndertowClient, io.undertow.server.HttpServerExchange, io.undertow.server.handlers.proxy.ProxyCallback, .ProxyConnection, io.undertow.util.Headers, .Methods, .SameThreadExecutor, .WorkerUtils, org.xnio.ChannelExceptionHandler, .ChannelListener, .ChannelListeners, .IoFuture, .IoUtils, .OptionMap, .StreamConnection, .XnioExecutor, .XnioIoThread, .XnioWorker, io.undertow.connector.ByteBufferPool, org.xnio.channels.StreamSinkChannel, .StreamSourceChannel, org.xnio.ssl.XnioSsl

Utilities to ping a remote node.
Author
Emanuel Muckenhuber

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static class
pack-priv static interface
pack-priv static class
pack-priv static enum

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
internalPingNode(Node
the node
node
,
NodePingUtil.PingCallback
the ping callback
callback
,
NodeHealthChecker healthChecker, XnioIoThread
the xnio i/o thread
ioThread
,
ByteBufferPool
the xnio buffer pool
bufferPool
,
UndertowClient
the undertow client
client
,
XnioSsl
the ssl setup
xnioSsl
,
OptionMap
the options
options
)

Internally ping a node.

pack-priv static void
pingHost(InetSocketAddress
the socket address
address
,
HttpServerExchange
the http servers exchange
exchange
,
NodePingUtil.PingCallback
the ping callback
callback
,
OptionMap
the options
options
)

Try to open a socket connection to given address.

pack-priv static void
pingHttpClient(URI
the connection URI
connection
,
NodePingUtil.PingCallback
the ping callback
callback
,
HttpServerExchange
the http servers exchange
exchange
,
UndertowClient
the undertow client
client
,
XnioSsl
the ssl setup
xnioSsl
,
OptionMap
the options
options
)

Try to ping a server using the undertow client.

pack-priv static void
pingNode(final Node
the node
node
,
final HttpServerExchange
the http servers exchange
exchange
,
final NodePingUtil.PingCallback
the ping callback
callback
)

Try to ping a node using it's connection pool.

pack-priv static void
scheduleCancelTask(final XnioIoThread ioThread, final NodePingUtil.CancellableTask cancellable, final long timeout, final TimeUnit timeUnit)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NodePingUtilback to summary
pack-priv NodePingUtil()

Method Detail

internalPingNodeback to summary
pack-priv static void internalPingNode(Node node, NodePingUtil.PingCallback callback, NodeHealthChecker healthChecker, XnioIoThread ioThread, ByteBufferPool bufferPool, UndertowClient client, XnioSsl xnioSsl, OptionMap options)

Internally ping a node. This should probably use the connections from the nodes pool, if there are any available.

Parameters
node:Node

the node

callback:NodePingUtil.PingCallback

the ping callback

ioThread:XnioIoThread

the xnio i/o thread

bufferPool:ByteBufferPool

the xnio buffer pool

client:UndertowClient

the undertow client

xnioSsl:XnioSsl

the ssl setup

options:OptionMap

the options

pingHostback to summary
pack-priv static void pingHost(InetSocketAddress address, HttpServerExchange exchange, NodePingUtil.PingCallback callback, OptionMap options)

Try to open a socket connection to given address.

Parameters
address:InetSocketAddress

the socket address

exchange:HttpServerExchange

the http servers exchange

callback:NodePingUtil.PingCallback

the ping callback

options:OptionMap

the options

pingHttpClientback to summary
pack-priv static void pingHttpClient(URI connection, NodePingUtil.PingCallback callback, HttpServerExchange exchange, UndertowClient client, XnioSsl xnioSsl, OptionMap options)

Try to ping a server using the undertow client.

Parameters
connection:URI

the connection URI

callback:NodePingUtil.PingCallback

the ping callback

exchange:HttpServerExchange

the http servers exchange

client:UndertowClient

the undertow client

xnioSsl:XnioSsl

the ssl setup

options:OptionMap

the options

pingNodeback to summary
pack-priv static void pingNode(final Node node, final HttpServerExchange exchange, final NodePingUtil.PingCallback callback)

Try to ping a node using it's connection pool.

Parameters
node:Node

the node

exchange:HttpServerExchange

the http servers exchange

callback:NodePingUtil.PingCallback

the ping callback

scheduleCancelTaskback to summary
pack-priv static void scheduleCancelTask(final XnioIoThread ioThread, final NodePingUtil.CancellableTask cancellable, final long timeout, final TimeUnit timeUnit)
io.undertow.server.handlers.proxy.mod_cluster back to summary

pack-priv Class NodePingUtil.CancellableTask

extends Object
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.proxy.mod_cluster.NodePingUtil.CancellableTask
Known Direct Subclasses
io.undertow.server.handlers.proxy.mod_cluster.NodePingUtil.HostPingTask, io.undertow.server.handlers.proxy.mod_cluster.NodePingUtil.RequestExchangeListener

Field Summary

Modifier and TypeField and Description
private volatile XnioExecutor.Key
private final NodePingUtil.PingCallback
private volatile NodePingUtil.State

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
pack-priv boolean
pack-priv void
pack-priv void
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cancelKeyback to summary
private volatile XnioExecutor.Key cancelKey
delegateback to summary
private final NodePingUtil.PingCallback delegate
stateback to summary
private volatile NodePingUtil.State state

Constructor Detail

CancellableTaskback to summary
pack-priv CancellableTask(NodePingUtil.PingCallback callback)

Method Detail

cancelback to summary
pack-priv void cancel()
isDoneback to summary
pack-priv boolean isDone()
setCancelKeyback to summary
pack-priv void setCancelKey(XnioExecutor.Key cancelKey)
taskCompletedback to summary
pack-priv void taskCompleted()
taskFailedback to summary
pack-priv void taskFailed()
io.undertow.server.handlers.proxy.mod_cluster back to summary

pack-priv Class NodePingUtil.ConnectionPoolPingTask

extends Object
implements Runnable
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.proxy.mod_cluster.NodePingUtil.ConnectionPoolPingTask
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private final NodePingUtil.RequestExchangeListener
private final ProxyConnection
private final URI

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

exchangeListenerback to summary
private final NodePingUtil.RequestExchangeListener exchangeListener
proxyConnectionback to summary
private final ProxyConnection proxyConnection
uriback to summary
private final URI uri

Constructor Detail

ConnectionPoolPingTaskback to summary
pack-priv ConnectionPoolPingTask(ProxyConnection proxyConnection, NodePingUtil.RequestExchangeListener exchangeListener, URI uri)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
io.undertow.server.handlers.proxy.mod_cluster back to summary

pack-priv Class NodePingUtil.HostPingTask

extends CancellableTask
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private final InetSocketAddress
private final OptionMap
private final XnioWorker

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from io.undertow.server.handlers.proxy.mod_cluster.NodePingUtil.CancellableTask:
cancelisDonesetCancelKeytaskCompletedtaskFailed

Field Detail

addressback to summary
private final InetSocketAddress address
optionsback to summary
private final OptionMap options
workerback to summary
private final XnioWorker worker

Constructor Detail

HostPingTaskback to summary
pack-priv HostPingTask(InetSocketAddress address, XnioWorker worker, NodePingUtil.PingCallback callback, OptionMap options)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
io.undertow.server.handlers.proxy.mod_cluster back to summary

pack-priv Class NodePingUtil.HttpClientPingTask

extends Object
implements Runnable
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.proxy.mod_cluster.NodePingUtil.HttpClientPingTask
All Implemented Interfaces
java.lang.Runnable

Field Summary

Modifier and TypeField and Description
private final ByteBufferPool
private final UndertowClient
private final URI
private final NodePingUtil.RequestExchangeListener
private final OptionMap
private final XnioIoThread
private final XnioSsl

Constructor Summary

AccessConstructor and Description
pack-priv
HttpClientPingTask(URI connection, NodePingUtil.RequestExchangeListener exchangeListener, XnioIoThread thread, UndertowClient client, XnioSsl xnioSsl, ByteBufferPool bufferPool, OptionMap options)

Method Summary

Modifier and TypeMethod and Description
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferPoolback to summary
private final ByteBufferPool bufferPool
clientback to summary
private final UndertowClient client
connectionback to summary
private final URI connection
exchangeListenerback to summary
private final NodePingUtil.RequestExchangeListener exchangeListener
optionsback to summary
private final OptionMap options
threadback to summary
private final XnioIoThread thread
xnioSslback to summary
private final XnioSsl xnioSsl

Constructor Detail

HttpClientPingTaskback to summary
pack-priv HttpClientPingTask(URI connection, NodePingUtil.RequestExchangeListener exchangeListener, XnioIoThread thread, UndertowClient client, XnioSsl xnioSsl, ByteBufferPool bufferPool, OptionMap options)

Method Detail

runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
io.undertow.server.handlers.proxy.mod_cluster back to summary

pack-priv Interface NodePingUtil.PingCallback


Method Summary

Modifier and TypeMethod and Description
public void
completed()

Ping completed.

public void
failed()

Ping failed.

Method Detail

completedback to summary
public void completed()

Ping completed.

failedback to summary
public void failed()

Ping failed.

io.undertow.server.handlers.proxy.mod_cluster back to summary

pack-priv Class NodePingUtil.RequestExchangeListener

extends CancellableTask
implements ClientCallback<ClientExchange>
Class Inheritance
All Implemented Interfaces
io.undertow.client.ClientCallback

Field Summary

Modifier and TypeField and Description
private final boolean
private ClientExchange
private final NodeHealthChecker

Constructor Summary

AccessConstructor and Description
pack-priv
RequestExchangeListener(NodePingUtil.PingCallback callback, NodeHealthChecker healthChecker, boolean closeConnection)

Method Summary

Modifier and TypeMethod and Description
public void
completed(final ClientExchange
the operation result
result
)

Implements io.undertow.client.ClientCallback.completed.

Invoked when an operation completed.

public void
failed(IOException
the exception
e
)

Implements io.undertow.client.ClientCallback.failed.

Invoked when the operation failed.

Inherited from io.undertow.server.handlers.proxy.mod_cluster.NodePingUtil.CancellableTask:
cancelisDonesetCancelKeytaskCompletedtaskFailed

Field Detail

closeConnectionback to summary
private final boolean closeConnection
exchangeback to summary
private ClientExchange exchange
healthCheckerback to summary
private final NodeHealthChecker healthChecker

Constructor Detail

RequestExchangeListenerback to summary
pack-priv RequestExchangeListener(NodePingUtil.PingCallback callback, NodeHealthChecker healthChecker, boolean closeConnection)

Method Detail

completedback to summary
public void completed(final ClientExchange result)

Implements io.undertow.client.ClientCallback.completed.

Doc from io.undertow.client.ClientCallback.completed.

Invoked when an operation completed.

Parameters
result:ClientExchange

the operation result

Annotations
@Override
failedback to summary
public void failed(IOException e)

Implements io.undertow.client.ClientCallback.failed.

Doc from io.undertow.client.ClientCallback.failed.

Invoked when the operation failed.

Parameters
e:IOException

the exception

Annotations
@Override
io.undertow.server.handlers.proxy.mod_cluster back to summary

pack-priv final Enum NodePingUtil.State

extends Enum<NodePingUtil.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final NodePingUtil.State
public static final NodePingUtil.State
public static final NodePingUtil.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static NodePingUtil.State
public static NodePingUtil.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CANCELLEDback to summary
public static final NodePingUtil.State CANCELLED
DONEback to summary
public static final NodePingUtil.State DONE
WAITINGback to summary
public static final NodePingUtil.State WAITING

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static NodePingUtil.State valueOf(String name)
valuesback to summary
public static NodePingUtil.State[] values()