Class AxonServerManagedChannel
- java.lang.Object
-
- io.grpc.Channel
-
- io.grpc.ManagedChannel
-
- io.axoniq.axonserver.connector.impl.AxonServerManagedChannel
-
public class AxonServerManagedChannel extends io.grpc.ManagedChannelAxonServer specificManagedChannelimplementation providing AxonServer specific connection logic.
-
-
Constructor Summary
Constructors Constructor Description AxonServerManagedChannel(List<ServerAddress> routingServers, ReconnectConfiguration reconnectConfiguration, String context, ClientIdentification clientIdentification, ScheduledExecutorService executor, BiFunction<ServerAddress,String,io.grpc.ManagedChannel> connectionFactory)Constructs aAxonServerManagedChannel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringauthority()booleanawaitTermination(long timeout, TimeUnit unit)voidenterIdle()io.grpc.ConnectivityStategetState(boolean requestConnection)booleanisReady()Indicates whether the channel is READY, meaning is is connected to an Axon Server instance, and ready to accept calls.booleanisShutdown()booleanisTerminated()<REQ,RESP>
io.grpc.ClientCall<REQ,RESP>newCall(io.grpc.MethodDescriptor<REQ,RESP> methodDescriptor, io.grpc.CallOptions callOptions)voidnotifyWhenStateChanged(io.grpc.ConnectivityState source, Runnable callback)voidrequestReconnect()Requests a dedicated reconnect of thisManagedChannelimplementation.voidresetConnectBackoff()io.grpc.ManagedChannelshutdown()io.grpc.ManagedChannelshutdownNow()
-
-
-
Constructor Detail
-
AxonServerManagedChannel
public AxonServerManagedChannel(List<ServerAddress> routingServers, ReconnectConfiguration reconnectConfiguration, String context, ClientIdentification clientIdentification, ScheduledExecutorService executor, BiFunction<ServerAddress,String,io.grpc.ManagedChannel> connectionFactory)
Constructs aAxonServerManagedChannel.- Parameters:
routingServers-ListofServerAddress' denoting the instances to connect withreconnectConfiguration- configuration holder defining how thisManagedChannelimplementation should reconnectcontext- the context thisManagedChanneloperates inclientIdentification- the information identifying the client application which is connecting. This information is used to form the connection with a clientexecutor-ScheduledExecutorServiceused to schedule operations to ensure the connection is maintainedconnectionFactory- factory method able of creating newManagedChannelinstances based on a givenServerAddressand context
-
-
Method Detail
-
shutdown
public io.grpc.ManagedChannel shutdown()
- Specified by:
shutdownin classio.grpc.ManagedChannel
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin classio.grpc.ManagedChannel
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin classio.grpc.ManagedChannel
-
shutdownNow
public io.grpc.ManagedChannel shutdownNow()
- Specified by:
shutdownNowin classio.grpc.ManagedChannel
-
awaitTermination
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException- Specified by:
awaitTerminationin classio.grpc.ManagedChannel- Throws:
InterruptedException
-
newCall
public <REQ,RESP> io.grpc.ClientCall<REQ,RESP> newCall(io.grpc.MethodDescriptor<REQ,RESP> methodDescriptor, io.grpc.CallOptions callOptions)- Specified by:
newCallin classio.grpc.Channel
-
authority
public String authority()
- Specified by:
authorityin classio.grpc.Channel
-
getState
public io.grpc.ConnectivityState getState(boolean requestConnection)
- Overrides:
getStatein classio.grpc.ManagedChannel
-
notifyWhenStateChanged
public void notifyWhenStateChanged(io.grpc.ConnectivityState source, Runnable callback)- Overrides:
notifyWhenStateChangedin classio.grpc.ManagedChannel
-
resetConnectBackoff
public void resetConnectBackoff()
- Overrides:
resetConnectBackoffin classio.grpc.ManagedChannel
-
enterIdle
public void enterIdle()
- Overrides:
enterIdlein classio.grpc.ManagedChannel
-
requestReconnect
public void requestReconnect()
Requests a dedicated reconnect of thisManagedChannelimplementation.
-
isReady
public boolean isReady()
Indicates whether the channel is READY, meaning is is connected to an Axon Server instance, and ready to accept calls.- Returns:
trueif the connection is ready to accept calls, otherwisefalse
-
-