Class AMQPFederationEventDispatcher

java.lang.Object
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationEventDispatcher
All Implemented Interfaces:
ActiveMQServerAddressPlugin, ActiveMQServerBasePlugin, ActiveMQServerBindingPlugin, SenderController

public class AMQPFederationEventDispatcher extends Object implements SenderController, ActiveMQServerBindingPlugin, ActiveMQServerAddressPlugin
Sender controller used to fire events from one side of an AMQP Federation connection to the other side.
  • Constructor Details

    • AMQPFederationEventDispatcher

      public AMQPFederationEventDispatcher(AMQPFederation federation, AMQPSessionCallback session, org.apache.qpid.proton.engine.Sender sender)
  • Method Details

    • sendEvent

      public void sendEvent(AMQPMessage event) throws Exception
      Raw event send API that accepts an AMQPMessage instance and routes it using the server post office instance.
      Parameters:
      event - The event message to send to the previously created control address.
      Throws:
      Exception - if an error occurs during the message send.
    • init

      public org.apache.activemq.artemis.core.server.Consumer init(ProtonServerSenderContext senderContext) throws Exception
      Description copied from interface: SenderController
      Initialize sender controller state and handle open of AMQP sender resources
      Specified by:
      init in interface SenderController
      Parameters:
      senderContext - The sender context that is requesting controller initialization.
      Returns:
      a server consumer that has been initialize by the controller
      Throws:
      Exception - if an error occurs during initialization.
    • close

      public void close(boolean remoteClose)
      Description copied from interface: SenderController
      Handle close of the sever sender AMQP resources either from remote link detach or local close usually due to connection drop.
      Specified by:
      close in interface SenderController
      Parameters:
      remoteClose - Indicates if the remote link detached the sender or local action closed it.
    • close

      public void close(org.apache.qpid.proton.amqp.transport.ErrorCondition error)
      Description copied from interface: SenderController
      Called when the sender is being locally closed due to some error or forced shutdown due to resource deletion etc. The default implementation of this API does nothing in response to this call.
      Specified by:
      close in interface SenderController
      Parameters:
      error - The error condition that triggered the close.
    • addAddressWatch

      public void addAddressWatch(String addressName)
      Add the given address name to the set of addresses that should be watched for and if added to the broker send an event to the remote indicating that it now exists and the remote should attempt to create a new address federation consumer.

      This method must be called from the connection thread.

      Parameters:
      addressName - The address name to watch for addition.
    • addQueueWatch

      public void addQueueWatch(String queueName)
      Add the given queue name to the set of queues that should be watched for and if added to the broker send an event to the remote indicating that it now exists and the remote should attempt to create a new queue federation consumer.

      This method must be called from the connection thread.

      Parameters:
      queueName - The queue name to watch for addition.
    • afterAddAddress

      public void afterAddAddress(org.apache.activemq.artemis.core.server.impl.AddressInfo addressInfo, boolean reload) throws ActiveMQException
      Specified by:
      afterAddAddress in interface ActiveMQServerAddressPlugin
      Throws:
      ActiveMQException
    • afterAddBinding

      public void afterAddBinding(org.apache.activemq.artemis.core.postoffice.Binding binding) throws ActiveMQException
      Specified by:
      afterAddBinding in interface ActiveMQServerBindingPlugin
      Throws:
      ActiveMQException