public class AxonServerConnectionManager extends Object
Channel
s per context and providing them as the means to dispatch/receive messages.Modifier and Type | Class and Description |
---|---|
static class |
AxonServerConnectionManager.Builder
Builder class to instantiate an
AxonServerConnectionManager . |
Modifier | Constructor and Description |
---|---|
protected |
AxonServerConnectionManager(AxonServerConnectionManager.Builder builder,
io.axoniq.axonserver.connector.AxonServerConnectionFactory connectionFactory)
Instantiate a
AxonServerConnectionManager based on the fields contained in the AxonServerConnectionManager.Builder , using the
given connectionFactory to obtain connections to AxonServer. |
Modifier and Type | Method and Description |
---|---|
static AxonServerConnectionManager.Builder |
builder()
Instantiate a Builder to be able to create an
AxonServerConnectionManager . |
void |
disconnect()
Disconnects any active connections, forcing a new connection to be established when one is requested.
|
void |
disconnect(String context)
Disconnects any active connection for the given
context , forcing a new connection to be established when
one is requested. |
io.grpc.Channel |
getChannel()
Deprecated.
|
io.grpc.Channel |
getChannel(String context)
Deprecated.
|
io.axoniq.axonserver.connector.AxonServerConnection |
getConnection()
Retrieves the
AxonServerConnection used for the default context of this application. |
io.axoniq.axonserver.connector.AxonServerConnection |
getConnection(String context)
Retrieves the
AxonServerConnection used for the given context of this application. |
String |
getDefaultContext()
Returns the name of the default context of this application.
|
boolean |
isConnected(String context)
Returns
true if a gRPC channel for the specific context is opened between client and AxonServer. |
void |
shutdown()
Stops the Connection Manager, closing any active connections and preventing new connections from being created.
|
void |
start()
Starts the
AxonServerConnectionManager . |
protected AxonServerConnectionManager(AxonServerConnectionManager.Builder builder, io.axoniq.axonserver.connector.AxonServerConnectionFactory connectionFactory)
AxonServerConnectionManager
based on the fields contained in the AxonServerConnectionManager.Builder
, using the
given connectionFactory
to obtain connections to AxonServer.builder
- the AxonServerConnectionManager.Builder
used to instantiate a AxonServerConnectionManager
instanceconnectionFactory
- a configured instance of the AxonServerConnectionFactorypublic static AxonServerConnectionManager.Builder builder()
AxonServerConnectionManager
.
The TagsConfiguration
is defaulted to TagsConfiguration()
. The AxonServerConfiguration
is a hard requirements and as such should be provided.
AxonServerConnectionManager
@StartHandler(phase=1073741833) public void start()
AxonServerConnectionManager
. Will enable heartbeat messages to be send to the connected Axon
Server instance in the Phase.INSTRUCTION_COMPONENTS
phase, if this has been enabled through the AxonServerConfiguration.HeartbeatConfiguration.isEnabled()
.public io.axoniq.axonserver.connector.AxonServerConnection getConnection()
AxonServerConnection
used for the default context of this application.AxonServerConnection
used for the default context of this applicationpublic io.axoniq.axonserver.connector.AxonServerConnection getConnection(String context)
AxonServerConnection
used for the given context
of this application.context
- the context for which to retrieve an AxonServerConnection
AxonServerConnection
used for the given context
of this application.public boolean isConnected(String context)
true
if a gRPC channel for the specific context is opened between client and AxonServer.context
- the (Bounded) Context for for which is verified the AxonServer connection through the gRPC
channel@ShutdownHandler(phase=-134217728) public void shutdown()
Phase.EXTERNAL_CONNECTIONS
phase.public void disconnect(String context)
context
, forcing a new connection to be established when
one is requested.context
- the context for which the connection must be disconnectedpublic void disconnect()
public String getDefaultContext()
@Deprecated public io.grpc.Channel getChannel()
@Deprecated public io.grpc.Channel getChannel(String context)
Copyright © 2010–2022. All rights reserved.