Class AMQPFederationAddressPolicyManager
java.lang.Object
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationPolicyManager
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationLocalPolicyManager
org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationAddressPolicyManager
- All Implemented Interfaces:
ActiveMQServerAddressPlugin, ActiveMQServerBasePlugin, ActiveMQServerBindingPlugin
public final class AMQPFederationAddressPolicyManager
extends AMQPFederationLocalPolicyManager
implements ActiveMQServerAddressPlugin
The AMQP Federation implementation of an federation address policy manager.
-
Nested Class Summary
Nested classes/interfaces inherited from class AMQPFederationPolicyManager
AMQPFederationPolicyManager.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String, org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationAddressPolicyManager.AMQPFederationAddressConsumerRegistry> protected final Stringprotected final Map<org.apache.activemq.artemis.core.postoffice.impl.DivertBinding, Set<org.apache.activemq.artemis.core.postoffice.QueueBinding>> protected final FederationReceiveFromAddressPolicyFields inherited from class AMQPFederationLocalPolicyManager
configurationFields inherited from class AMQPFederationPolicyManager
connected, federation, metrics, policyName, policyType, server, session, state -
Constructor Summary
ConstructorsConstructorDescriptionAMQPFederationAddressPolicyManager(AMQPFederation federation, AMQPFederationMetrics metrics, FederationReceiveFromAddressPolicy addressPolicy) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterAddAddress(org.apache.activemq.artemis.core.server.impl.AddressInfo addressInfo, boolean reload) voidafterAddBinding(org.apache.activemq.artemis.core.postoffice.Binding binding) voidafterRemoveAddress(SimpleString address, org.apache.activemq.artemis.core.server.impl.AddressInfo addressInfo) voidafterRemoveBinding(org.apache.activemq.artemis.core.postoffice.Binding binding, org.apache.activemq.artemis.core.transaction.Transaction tx, boolean deleteData) Returns the immutable federation policy configuration that backs this manager.protected voidsafeCleanupManagerResources(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.protected voidScans all bindings and push them through the normal bindings checks that would be done on an add.protected voidupdateStateAfterConnect(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.Methods inherited from class AMQPFederationLocalPolicyManager
getConfiguration, handleConnectionInterrupted, handleConnectionRestored, handleManagerInitialized, handleManagerShutdown, handleManagerStarted, handleManagerStopped, isPluginBlockingFederationConsumerCreate, isPluginBlockingFederationConsumerCreate, isPluginBlockingFederationConsumerCreate, signalPluginAfterCloseFederationConsumer, signalPluginAfterCreateFederationConsumer, signalPluginBeforeCloseFederationConsumer, signalPluginBeforeCreateFederationConsumer, tryCloseFederationConsumerMethods inherited from class AMQPFederationPolicyManager
connectionInterrupted, connectionRestored, failIfShutdown, getFederation, getMetrics, getPolicyName, getPolicyType, initialize, isActive, isConnected, isStarted, shutdown, start, stopMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ActiveMQServerAddressPlugin
afterUpdateAddress, beforeAddAddress, beforeRemoveAddress, beforeUpdateAddressMethods inherited from interface ActiveMQServerBasePlugin
init, registered, setInit, unregisteredMethods inherited from interface ActiveMQServerBindingPlugin
beforeAddBinding, beforeRemoveBinding
-
Field Details
-
baseConsumerFilter
-
policy
-
addressTracking
-
divertsTracking
-
-
Constructor Details
-
AMQPFederationAddressPolicyManager
public AMQPFederationAddressPolicyManager(AMQPFederation federation, AMQPFederationMetrics metrics, FederationReceiveFromAddressPolicy addressPolicy) throws ActiveMQException - Throws:
ActiveMQException
-
-
Method Details
-
getPolicy
Description copied from class:AMQPFederationLocalPolicyManagerReturns the immutable federation policy configuration that backs this manager.- Specified by:
getPolicyin classAMQPFederationLocalPolicyManager- Returns:
- the receive from address policy that backs the address policy manager
-
updateStateAfterConnect
protected void updateStateAfterConnect(AMQPFederationConsumerConfiguration configuration, AMQPSessionContext session) Description copied from class:AMQPFederationLocalPolicyManagerAllows 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.- Specified by:
updateStateAfterConnectin classAMQPFederationLocalPolicyManager- Parameters:
configuration- The updated configuration based on the current connection.session- The session that matches the current connection.
-
safeCleanupManagerResources
protected void safeCleanupManagerResources(boolean force) Description copied from class:AMQPFederationLocalPolicyManagerThe 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.- Specified by:
safeCleanupManagerResourcesin classAMQPFederationLocalPolicyManager- Parameters:
force- Should the implementation simply close the consumers without attempting a stop.
-
afterRemoveAddress
public void afterRemoveAddress(SimpleString address, org.apache.activemq.artemis.core.server.impl.AddressInfo addressInfo) throws ActiveMQException - Specified by:
afterRemoveAddressin interfaceActiveMQServerAddressPlugin- Throws:
ActiveMQException
-
afterRemoveBinding
public void afterRemoveBinding(org.apache.activemq.artemis.core.postoffice.Binding binding, org.apache.activemq.artemis.core.transaction.Transaction tx, boolean deleteData) throws ActiveMQException - Specified by:
afterRemoveBindingin interfaceActiveMQServerBindingPlugin- Throws:
ActiveMQException
-
scanAllBindings
protected void scanAllBindings()Description copied from class:AMQPFederationLocalPolicyManagerScans 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.- Specified by:
scanAllBindingsin classAMQPFederationLocalPolicyManager
-
afterAddAddress
public void afterAddAddress(org.apache.activemq.artemis.core.server.impl.AddressInfo addressInfo, boolean reload) - Specified by:
afterAddAddressin interfaceActiveMQServerAddressPlugin
-
afterAddBinding
public void afterAddBinding(org.apache.activemq.artemis.core.postoffice.Binding binding) - Specified by:
afterAddBindingin interfaceActiveMQServerBindingPlugin
-