Class AMQPFederationAddressPolicyManager
- java.lang.Object
-
- org.apache.activemq.artemis.protocol.amqp.federation.internal.FederationAddressPolicyManager
-
- org.apache.activemq.artemis.protocol.amqp.connect.federation.AMQPFederationAddressPolicyManager
-
- All Implemented Interfaces:
ActiveMQServerAddressPlugin,ActiveMQServerBasePlugin,ActiveMQServerBindingPlugin
public class AMQPFederationAddressPolicyManager extends FederationAddressPolicyManager
The AMQP Federation implementation of an federation address policy manager.
-
-
Field Summary
Fields Modifier and Type Field Description protected AMQPFederationConsumerConfigurationconfigurationprotected AMQPFederationfederationprotected StringremoteQueueFilterprotected AMQPSessionContextsession-
Fields inherited from class org.apache.activemq.artemis.protocol.amqp.federation.internal.FederationAddressPolicyManager
demandTracking, divertsTracking, policy, server
-
-
Constructor Summary
Constructors Constructor Description AMQPFederationAddressPolicyManager(AMQPFederation federation, FederationReceiveFromAddressPolicy addressPolicy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FederationGenericConsumerInfocreateConsumerInfo(org.apache.activemq.artemis.core.server.impl.AddressInfo address)Create a newFederationConsumerInfobased on the givenAddressInfoand the configuredFederationReceiveFromAddressPolicy.protected FederationConsumerInternalcreateFederationConsumer(FederationConsumerInfo consumerInfo)Create a newFederationConsumerInternalinstance using the consumer information given.protected StringgenerateQueueName(org.apache.activemq.artemis.core.server.impl.AddressInfo address)protected voidhandlePolicyManagerStarted(FederationReceiveFromAddressPolicy policy)Called on start of the manager before any other actions are taken to allow the subclass time to configure itself and prepare any needed state prior to starting management of federated resources.protected booleanisPluginBlockingFederationConsumerCreate(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.protected booleanisPluginBlockingFederationConsumerCreate(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 Queue.protected booleanisPluginBlockingFederationConsumerCreate(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.protected voidsignalAfterCloseFederationConsumer(FederationConsumer consumer)Signal any registered plugins for this federation instance that a remote Address consumer has now been closed.protected voidsignalAfterCreateFederationConsumer(FederationConsumer consumer)Signal any registered plugins for this federation instance that a remote Address consumer has been created.protected voidsignalBeforeCloseFederationConsumer(FederationConsumer consumer)Signal any registered plugins for this federation instance that a remote Address consumer is about to be closed.protected voidsignalBeforeCreateFederationConsumer(FederationConsumerInfo info)Signal any registered plugins for this federation instance that a remote Address consumer is being created.protected booleantestIfAddressMatchesPolicy(org.apache.activemq.artemis.core.server.impl.AddressInfo addressInfo)Performs the test against the configured address policy to check if the target address is a match or not.-
Methods inherited from class org.apache.activemq.artemis.protocol.amqp.federation.internal.FederationAddressPolicyManager
afterAddAddress, afterAddBinding, afterRemoteAddressAdded, afterRemoveAddress, afterRemoveBinding, checkBindingForMatch, createConsumerEntry, createOrUpdateFederatedAddressConsumerForBinding, reactIfAnyQueueBindingMatchesDivertTarget, reactIfQueueBindingMatchesAnyDivertTarget, scanAllBindings, start, stop, testIfAddressMatchesPolicy, tryRemoveDemandOnAddress
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerAddressPlugin
afterUpdateAddress, beforeAddAddress, beforeRemoveAddress, beforeUpdateAddress
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerBasePlugin
init, registered, setInit, unregistered
-
Methods inherited from interface org.apache.activemq.artemis.core.server.plugin.ActiveMQServerBindingPlugin
beforeAddBinding, beforeRemoveBinding
-
-
-
-
Field Detail
-
federation
protected final AMQPFederation federation
-
remoteQueueFilter
protected final String remoteQueueFilter
-
configuration
protected volatile AMQPFederationConsumerConfiguration configuration
-
session
protected volatile AMQPSessionContext session
-
-
Constructor Detail
-
AMQPFederationAddressPolicyManager
public AMQPFederationAddressPolicyManager(AMQPFederation federation, FederationReceiveFromAddressPolicy addressPolicy) throws ActiveMQException
- Throws:
ActiveMQException
-
-
Method Detail
-
handlePolicyManagerStarted
protected void handlePolicyManagerStarted(FederationReceiveFromAddressPolicy policy)
Description copied from class:FederationAddressPolicyManagerCalled on start of the manager before any other actions are taken to allow the subclass time to configure itself and prepare any needed state prior to starting management of federated resources.- Specified by:
handlePolicyManagerStartedin classFederationAddressPolicyManager- Parameters:
policy- The policy configuration for this policy manager.
-
createConsumerInfo
protected FederationGenericConsumerInfo createConsumerInfo(org.apache.activemq.artemis.core.server.impl.AddressInfo address)
Description copied from class:FederationAddressPolicyManagerCreate a newFederationConsumerInfobased on the givenAddressInfoand the configuredFederationReceiveFromAddressPolicy. A subclass must override this method to return a consumer information object with the data used be that implementation.- Specified by:
createConsumerInfoin classFederationAddressPolicyManager- Parameters:
address- TheAddressInfoto use as a basis for the consumer information object.- Returns:
- a new
FederationConsumerInfoinstance based on the given address.
-
generateQueueName
protected String generateQueueName(org.apache.activemq.artemis.core.server.impl.AddressInfo address)
-
createFederationConsumer
protected FederationConsumerInternal createFederationConsumer(FederationConsumerInfo consumerInfo)
Description copied from class:FederationAddressPolicyManagerCreate a newFederationConsumerInternalinstance using the consumer information given. This is called when local demand for a matched queue requires a new consumer to be created. This method by default will call the configured consumer factory function that was provided when the manager was created, a subclass can override this to perform additional actions for the create operation.- Specified by:
createFederationConsumerin classFederationAddressPolicyManager- Parameters:
consumerInfo- TheFederationConsumerInfothat defines the consumer to be created.- Returns:
- a new
FederationConsumerInternalinstance that will reside in this manager.
-
testIfAddressMatchesPolicy
protected boolean testIfAddressMatchesPolicy(org.apache.activemq.artemis.core.server.impl.AddressInfo addressInfo)
Description copied from class:FederationAddressPolicyManagerPerforms the test against the configured address policy to check if the target address is a match or not. A subclass can override this method and provide its own match tests in combination with the configured matching policy.- Overrides:
testIfAddressMatchesPolicyin classFederationAddressPolicyManager- Parameters:
addressInfo- The address that is being tested for a policy match.- Returns:
trueif the address given is a match against the policy.
-
signalBeforeCreateFederationConsumer
protected void signalBeforeCreateFederationConsumer(FederationConsumerInfo info)
Description copied from class:FederationAddressPolicyManagerSignal any registered plugins for this federation instance that a remote Address consumer is being created.- Specified by:
signalBeforeCreateFederationConsumerin classFederationAddressPolicyManager- Parameters:
info- TheFederationConsumerInfothat describes the remote Address consumer
-
signalAfterCreateFederationConsumer
protected void signalAfterCreateFederationConsumer(FederationConsumer consumer)
Description copied from class:FederationAddressPolicyManagerSignal any registered plugins for this federation instance that a remote Address consumer has been created.- Specified by:
signalAfterCreateFederationConsumerin classFederationAddressPolicyManager- Parameters:
consumer- TheFederationConsumerInfothat describes the remote Address consumer
-
signalBeforeCloseFederationConsumer
protected void signalBeforeCloseFederationConsumer(FederationConsumer consumer)
Description copied from class:FederationAddressPolicyManagerSignal any registered plugins for this federation instance that a remote Address consumer is about to be closed.- Specified by:
signalBeforeCloseFederationConsumerin classFederationAddressPolicyManager- Parameters:
consumer- TheFederationConsumerthat that is about to be closed.
-
signalAfterCloseFederationConsumer
protected void signalAfterCloseFederationConsumer(FederationConsumer consumer)
Description copied from class:FederationAddressPolicyManagerSignal any registered plugins for this federation instance that a remote Address consumer has now been closed.- Specified by:
signalAfterCloseFederationConsumerin classFederationAddressPolicyManager- Parameters:
consumer- TheFederationConsumerthat that has been closed.
-
isPluginBlockingFederationConsumerCreate
protected final boolean isPluginBlockingFederationConsumerCreate(org.apache.activemq.artemis.core.server.impl.AddressInfo address)
Description copied from class:FederationAddressPolicyManagerQuery all registered plugins for this federation instance to determine if any wish to prevent a federation consumer from being created for the given Queue.- Specified by:
isPluginBlockingFederationConsumerCreatein classFederationAddressPolicyManager- 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)Description copied from class:FederationAddressPolicyManagerQuery all registered plugins for this federation instance to determine if any wish to prevent a federation consumer from being created for the given Queue.- Specified by:
isPluginBlockingFederationConsumerCreatein classFederationAddressPolicyManager- Parameters:
divert- TheDivertthat triggered the manager to attempt to create a remote consumer.queue- TheQueuethat 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)
Description copied from class:FederationAddressPolicyManagerQuery all registered plugins for this federation instance to determine if any wish to prevent a federation consumer from being created for the given Queue.- Specified by:
isPluginBlockingFederationConsumerCreatein classFederationAddressPolicyManager- Parameters:
queue- TheQueuethat triggered the manager to attempt to create a remote consumer.- Returns:
- true if any registered plugin signaled that creation should be suppressed.
-
-