public class ContextConnection extends Object implements AxonServerConnection
AxonServerConnection, carrying context information with the overall connection. The
context information can be used to support the notion of bounded contexts or multi-tenancy for example.| Constructor and Description |
|---|
ContextConnection(ClientIdentification clientIdentification,
ScheduledExecutorService executorService,
AxonServerManagedChannel connection,
long processorInfoUpdateFrequency,
int commandPermits,
int queryPermits,
String context,
Consumer<ContextConnection> onShutdown)
Construct a
ContextConnection carrying context information. |
| Modifier and Type | Method and Description |
|---|---|
AdminChannel |
adminChannel()
Returns the channel on which administration messages can be sent and received
|
CommandChannel |
commandChannel()
Returns the channel on which Command related interactions can be performed with AxonServer.
|
void |
connect()
Ensure there is a connection with the
ControlChannel this connection provides. |
ControlChannel |
controlChannel()
Returns the channel on which platform control messages can be sent and received.
|
void |
disconnect()
Disconnects all communication channels and terminates any active network connections to AxonServer.
|
EventChannel |
eventChannel()
Returns the channel on which Event related interactions can be performed with AxonServer.
|
AxonServerManagedChannel |
getManagedChannel()
Retrieve the
AxonServerManagedChannel used to create connection with. |
boolean |
isConnected()
Indicates whether the underlying connection is active.
|
boolean |
isConnectionFailed()
Indicates whether the underlying connection failed.
|
boolean |
isReady()
Indicates whether the connection is ready to process and receive instructions.
|
QueryChannel |
queryChannel()
Returns the channel on which Query related interactions can be performed with AxonServer.
|
public ContextConnection(ClientIdentification clientIdentification, ScheduledExecutorService executorService, AxonServerManagedChannel connection, long processorInfoUpdateFrequency, int commandPermits, int queryPermits, String context, Consumer<ContextConnection> onShutdown)
ContextConnection carrying context information.clientIdentification - client information identifying whom has connected. This information is used
to pass on to messageexecutorService - a ScheduledExecutorService used to schedule reconnects in the
channels this connection providesconnection - the AxonServerManagedChannel used to form the connections with
AxonServerprocessorInfoUpdateFrequency - the update frequency in milliseconds of event processor informationcommandPermits - the number of permits for command streamsqueryPermits - the number of permits for query streamscontext - the context this connection belongs toonShutdown - a shutdown hook to invoke whenever this ContextConnection
disconnectspublic boolean isConnectionFailed()
AxonServerConnectionisConnectionFailed in interface AxonServerConnectiontrue when the underlying connection failed, otherwise falsepublic boolean isReady()
AxonServerConnectionAxonServerConnection.isConnected() and if all previously active communication
channels (e.g. command, query, instruction) have been activated.isReady in interface AxonServerConnectiontrue if the underlying connection is ready, otherwise falsepublic boolean isConnected()
AxonServerConnectionisConnected in interface AxonServerConnectiontrue if a network connection to AxonServer is available, otherwise falsepublic void disconnect()
AxonServerConnectiondisconnect().disconnect in interface AxonServerConnectionpublic ControlChannel controlChannel()
AxonServerConnectioncontrolChannel in interface AxonServerConnectionpublic void connect()
ControlChannel this connection provides.public CommandChannel commandChannel()
AxonServerConnectioncommandChannel in interface AxonServerConnectionpublic EventChannel eventChannel()
AxonServerConnectioneventChannel in interface AxonServerConnectionpublic QueryChannel queryChannel()
AxonServerConnectionqueryChannel in interface AxonServerConnectionpublic AdminChannel adminChannel()
AxonServerConnectionadminChannel in interface AxonServerConnectionpublic AxonServerManagedChannel getManagedChannel()
AxonServerManagedChannel used to create connection with.AxonServerManagedChannel used to create connection withCopyright © 2020–2022 AxonIQ BV. All rights reserved.