Interface ControlChannel

  • All Known Implementing Classes:
    ControlChannelImpl

    public interface ControlChannel
    Communication channel for interactions with AxonServer related to control messages and statistics.
    • Method Detail

      • registerInstructionHandler

        Registration registerInstructionHandler​(PlatformOutboundInstruction.RequestCase type,
                                                InstructionHandler<PlatformOutboundInstruction,​PlatformInboundInstruction> handler)
        Registers the given handler to handle a given type of instruction. Any previous registrations of handlers for the given type of instruction are overwritten.

        Note that de-registration of a handler will not reinstate any previously registered handler for the same type of instruction.

        This method is intended to overwrite the default behavior for incoming instructions, or to provide support for non-default instructions.

        Parameters:
        type - the type of instructions to handle
        handler - the handler to invoke for incoming instructions
        Returns:
        a handle to deregister this instruction handler
      • registerTopologyChangeHandler

        Registration registerTopologyChangeHandler​(Consumer<TopologyChange> handler)
        Registers a handler for changes in the topology of AxonServer. This handler will be invoked whenever there is a change in the topology, such as a new command or query handler being registered, or a handler being deregistered.
        Parameters:
        handler - for changes in the topology of AxonServer.
        Returns:
        a handle to deregister the topology change handler
      • registerEventProcessor

        Registration registerEventProcessor​(String processorName,
                                            Supplier<EventProcessorInfo> infoSupplier,
                                            ProcessorInstructionHandler instructionHandler)
        Registers an Event Processor with AxonServer, allowing AxonServer to request status information and provide instructions for the Processor.
        Parameters:
        processorName - the name of the processor
        infoSupplier - supplier for up-to-date status information of the processor
        instructionHandler - handler for incoming instructions for the processor
        Returns:
        a handle to cancel the registration of the event processor
      • enableHeartbeat

        void enableHeartbeat​(long interval,
                             long timeout,
                             TimeUnit timeUnit)
        Enables sending heartbeat message to validate that the connection to AxonServer is alive. This ensures a fully operational end-to-end connection with AxonServer.

        When enabled, the client will abandon any connections on which no timely response to a heartbeat has been received. If heartbeats are also enabled on the AxonServer side, any heartbeat initiated by AxonServer will count as a valid connection confirmation.

        Consecutive invocations of this method will alter the configuration, resetting heartbeat timers and reinitialize the heartbeat processing.

        Parameters:
        interval - the interval at which heartbeat messages are expected
        timeout - the maximum time to wait for a confirmation after initiating a heartbeat message
        timeUnit - the unit of time in which interval and timeout are expressed
      • disableHeartbeat

        void disableHeartbeat()
        Disable any previously enabled heartbeats. Heartbeat requests initiated by AxonServer will still be reacted to, but the client will no longer initiate a heartbeat, nor close a connection when it fails to receive confirmations.