Class AMQPFederationLocalPolicyManager

java.lang.Object
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationPolicyManager
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationLocalPolicyManager
All Implemented Interfaces:
ActiveMQServerBasePlugin, ActiveMQServerBindingPlugin
Direct Known Subclasses:
AMQPFederationAddressPolicyManager, AMQPFederationQueuePolicyManager

public abstract class AMQPFederationLocalPolicyManager extends AMQPFederationPolicyManager implements ActiveMQServerBindingPlugin
A federation policy manager for policies that operate on the local side of this broker connection. These policies will create consumers on the remote which federate message back to this broker instance.
  • Field Details

  • Constructor Details

  • Method Details

    • getPolicy

      public abstract FederationReceiveFromResourcePolicy getPolicy()
      Returns the immutable federation policy configuration that backs this manager.
      Returns:
      the immutable federation policy configuration that backs this manager
    • getConfiguration

      protected AMQPFederationConsumerConfiguration getConfiguration()
      Returns the active configuration at this time the method is called.
      Returns:
      the active configuration at this time the method is called
    • handleManagerInitialized

      protected final void handleManagerInitialized()
      Description copied from class: AMQPFederationPolicyManager
      On initialize a federation policy manager needs to perform any specific initialization actions it requires to begin tracking broker resources.
      Specified by:
      handleManagerInitialized in class AMQPFederationPolicyManager
    • handleManagerStarted

      protected final void handleManagerStarted()
      Description copied from class: AMQPFederationPolicyManager
      On start a federation policy manager needs to perform any specific startup actions it requires to begin tracking broker resources.
      Specified by:
      handleManagerStarted in class AMQPFederationPolicyManager
    • handleManagerStopped

      protected final void handleManagerStopped()
      Description copied from class: AMQPFederationPolicyManager
      On stop a federation policy manager needs to perform any specific stopped actions it requires to cease tracking broker resources and cleanup.
      Specified by:
      handleManagerStopped in class AMQPFederationPolicyManager
    • handleManagerShutdown

      protected final void handleManagerShutdown()
      Description copied from class: AMQPFederationPolicyManager
      On shutdown a federation policy manager needs to perform any specific shutdown actions it requires to cease tracking broker resources.
      Specified by:
      handleManagerShutdown in class AMQPFederationPolicyManager
    • handleConnectionInterrupted

      protected final void handleConnectionInterrupted()
      Description copied from class: AMQPFederationPolicyManager
      On connection interrupted a federation policy manager needs to perform any specific actions to pause of cleanup current resources based on the connection being closed.
      Specified by:
      handleConnectionInterrupted in class AMQPFederationPolicyManager
    • handleConnectionRestored

      protected final void handleConnectionRestored()
      Description copied from class: AMQPFederationPolicyManager
      On connection restoration a federation policy manager needs to perform any specific actions to resume service based on a new connection having been established.
      Specified by:
      handleConnectionRestored in class AMQPFederationPolicyManager
    • updateStateAfterConnect

      protected abstract void updateStateAfterConnect(AMQPFederationConsumerConfiguration configuration, AMQPSessionContext session)
      Allows the policy manager implementation to update internal state after (re)connection and before the policy manager triggers a scan of all bindings to check for existing or new demand.
      Parameters:
      configuration - The updated configuration based on the current connection.
      session - The session that matches the current connection.
    • scanAllBindings

      protected abstract void scanAllBindings()
      Scans all bindings and push them through the normal bindings checks that would be done on an add. This allows for checks on demand after a start or after a connection is restored.
    • safeCleanupManagerResources

      protected abstract void safeCleanupManagerResources(boolean force)
      The subclass implements this method and should remove all tracked federation consumer data and also close all consumers either by first safely stopping the consumer or if offline simply closing the consumer. If the force flag is set to true the implementation should close the consumer without attempting to stop it by draining link credit before the close.
      Parameters:
      force - Should the implementation simply close the consumers without attempting a stop.
    • tryCloseFederationConsumer

      protected void tryCloseFederationConsumer(AMQPFederationConsumer federationConsuner)
      Attempts to close a federation consumer and signals the installed federation plugin of the impending and post closed state. The method will not double close a consumer as it checks the closed state. The method is synchronized to allow for use in asynchronous call backs from federation consumers.
      Parameters:
      federationConsuner - A federation consumer to close, or null in which case no action is taken.
    • signalPluginBeforeCreateFederationConsumer

      protected final void signalPluginBeforeCreateFederationConsumer(FederationConsumerInfo info)
      Signal any registered plugins for this federation instance that a remote consumer is being created.
      Parameters:
      info - The FederationConsumerInfo that describes the remote federation consumer
    • signalPluginAfterCreateFederationConsumer

      protected final void signalPluginAfterCreateFederationConsumer(FederationConsumer consumer)
      Signal any registered plugins for this federation instance that a remote consumer has been created.
      Parameters:
      consumer - The FederationConsumerInfo that describes the remote consumer
    • signalPluginBeforeCloseFederationConsumer

      protected final void signalPluginBeforeCloseFederationConsumer(FederationConsumer consumer)
      Signal any registered plugins for this federation instance that a remote consumer is about to be closed.
      Parameters:
      consumer - The FederationConsumer that that is about to be closed.
    • signalPluginAfterCloseFederationConsumer

      protected final void signalPluginAfterCloseFederationConsumer(FederationConsumer consumer)
      Signal any registered plugins for this federation instance that a remote consumer has now been closed.
      Parameters:
      consumer - The FederationConsumer that that has been closed.
    • isPluginBlockingFederationConsumerCreate

      protected final boolean isPluginBlockingFederationConsumerCreate(org.apache.activemq.artemis.core.server.impl.AddressInfo address)
      Query all registered plugins for this federation instance to determine if any wish to prevent a federation consumer from being created for the given resource.
      Parameters:
      address - The address on which the manager is intending to create a remote consumer for.
      Returns:
      true if any registered plugin signaled that creation should be suppressed
    • isPluginBlockingFederationConsumerCreate

      protected final boolean isPluginBlockingFederationConsumerCreate(org.apache.activemq.artemis.core.server.Divert divert, org.apache.activemq.artemis.core.server.Queue queue)
      Query all registered plugins for this federation instance to determine if any wish to prevent a federation consumer from being created for the given Queue.
      Parameters:
      divert - The Divert that triggered the manager to attempt to create a remote consumer.
      queue - The Queue that triggered the manager to attempt to create a remote consumer.
      Returns:
      true if any registered plugin signaled that creation should be suppressed
    • isPluginBlockingFederationConsumerCreate

      protected final boolean isPluginBlockingFederationConsumerCreate(org.apache.activemq.artemis.core.server.Queue queue)
      Query all registered plugins for this federation instance to determine if any wish to prevent a federation consumer from being created for the given Queue.
      Parameters:
      queue - The Queue that triggered the manager to attempt to create a remote consumer.
      Returns:
      true if any registered plugin signaled that creation should be suppressed