public class ClientTransport extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ClientTransport.ClientInputMessageSubscriptionImpl |
| Constructor and Description |
|---|
ClientTransport(ActorContext transportActorContext,
TransportContext transportContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<Void> |
closeAllChannels() |
CompletableFuture<Void> |
closeAsync() |
void |
deactivateRemoteAddress(RemoteAddress remote)
Signals that the remote is no longer in use for the time being.
|
long |
getChannelKeepAlivePeriod() |
ClientOutput |
getOutput() |
RemoteAddress |
getRemoteAddress(int streamId) |
RemoteAddress |
getRemoteAddress(SocketAddress addr) |
void |
interruptAllChannels() |
CompletableFuture<ClientInputMessageSubscription> |
openSubscription(String subscriptionName,
ClientMessageHandler messageHandler)
Creates a subscription on the receive buffer for single messages.
|
CompletableFuture<Void> |
registerChannelListener(TransportListener channelListener)
Registers a listener with callbacks for whenever a connection to a remote gets established or closed.
|
RemoteAddress |
registerRemoteAddress(SocketAddress addr)
Resolve a socket address as a remote to which data can be sent.
|
RemoteAddress |
registerRemoteAndAwaitChannel(SocketAddress addr)
DO NOT USE in production code as it involves blocking the current thread.
|
void |
removeChannelListener(TransportListener listener) |
void |
retireRemoteAddress(RemoteAddress remote)
Signals that the remote is no longer used and that the stream should not be reused on reactivation.
|
public ClientTransport(ActorContext transportActorContext, TransportContext transportContext)
public ClientOutput getOutput()
public RemoteAddress registerRemoteAddress(SocketAddress addr)
ClientTransport object, i.e.
can be cached. Transport will make sure to keep an open channel to this remote until the address
is deactivated or retired.public void deactivateRemoteAddress(RemoteAddress remote)
public void retireRemoteAddress(RemoteAddress remote)
remote - public RemoteAddress registerRemoteAndAwaitChannel(SocketAddress addr)
DO NOT USE in production code as it involves blocking the current thread.
Not thread-safe
Like registerRemoteAddress(SocketAddress) but blockingly waits for the corresponding channel
to be opened such that it is probable that subsequent requests/messages can be sent. This saves test code
the need to retry sending.
public RemoteAddress getRemoteAddress(SocketAddress addr)
public RemoteAddress getRemoteAddress(int streamId)
public CompletableFuture<ClientInputMessageSubscription> openSubscription(String subscriptionName, ClientMessageHandler messageHandler)
RuntimeException - if this client was not created with a receive buffer for single-messagespublic CompletableFuture<Void> registerChannelListener(TransportListener channelListener)
public void removeChannelListener(TransportListener listener)
public CompletableFuture<Void> closeAsync()
public void close()
close in interface AutoCloseablepublic void interruptAllChannels()
public CompletableFuture<Void> closeAllChannels()
public long getChannelKeepAlivePeriod()
Copyright © 2017–2018 camunda services GmbH. All rights reserved.