Class WildcardAddressManager
- java.lang.Object
-
- org.apache.activemq.artemis.core.postoffice.impl.SimpleAddressManager
-
- org.apache.activemq.artemis.core.postoffice.impl.WildcardAddressManager
-
- All Implemented Interfaces:
AddressManager
public class WildcardAddressManager extends SimpleAddressManager
extends the simple manager to allow wildcard addresses to be used.
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.core.postoffice.impl.SimpleAddressManager
mappings, metricsManager, wildcardConfiguration
-
-
Constructor Summary
Constructors Constructor Description WildcardAddressManager(BindingsFactory bindingsFactory, WildcardConfiguration wildcardConfiguration, StorageManager storageManager, MetricsManager metricsManager)WildcardAddressManager(BindingsFactory bindingsFactory, StorageManager storageManager, MetricsManager metricsManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddBinding(Binding binding)If the address to add the binding to contains a wildcard then a copy of the binding (with the same underlying queue) will be added to matching addresses.protected voidbindingsEmpty(SimpleString realAddress, Bindings bindings)voidclear()AddressMap<Bindings>getAddressMap()BindingsgetBindingsForRoutingAddress(SimpleString address)BindingremoveBinding(SimpleString uniqueName, Transaction tx)This will use a Transaction as we need to confirm the queue was removed-
Methods inherited from class org.apache.activemq.artemis.core.postoffice.impl.SimpleAddressManager
addAddressInfo, addMappingInternal, addMappingsInternal, checkAutoRemoveAddress, checkAutoRemoveAddress, getAddresses, getAddressInfo, getBinding, getBindings, getDirectBindings, getExistingBindingsForRoutingAddress, getMatchingBindings, getMatchingQueue, getMatchingQueue, reloadAddressInfo, removeAddressInfo, removeBindingInternal, scanAddresses, updateAddressInfo
-
-
-
-
Constructor Detail
-
WildcardAddressManager
public WildcardAddressManager(BindingsFactory bindingsFactory, WildcardConfiguration wildcardConfiguration, StorageManager storageManager, MetricsManager metricsManager)
-
WildcardAddressManager
public WildcardAddressManager(BindingsFactory bindingsFactory, StorageManager storageManager, MetricsManager metricsManager)
-
-
Method Detail
-
getBindingsForRoutingAddress
public Bindings getBindingsForRoutingAddress(SimpleString address) throws Exception
- Specified by:
getBindingsForRoutingAddressin interfaceAddressManager- Overrides:
getBindingsForRoutingAddressin classSimpleAddressManager- Throws:
Exception
-
addBinding
public boolean addBinding(Binding binding) throws Exception
If the address to add the binding to contains a wildcard then a copy of the binding (with the same underlying queue) will be added to matching addresses. If the address is non wildcard, then we need to add any existing matching wildcard bindings to this address the first time we see it.- Specified by:
addBindingin interfaceAddressManager- Overrides:
addBindingin classSimpleAddressManager- Parameters:
binding- the binding to add- Returns:
- true if the address was a new mapping
- Throws:
Exception
-
removeBinding
public Binding removeBinding(SimpleString uniqueName, Transaction tx) throws Exception
Description copied from interface:AddressManagerThis will use a Transaction as we need to confirm the queue was removed- Specified by:
removeBindingin interfaceAddressManager- Overrides:
removeBindingin classSimpleAddressManager- Returns:
- Throws:
Exception
-
bindingsEmpty
protected void bindingsEmpty(SimpleString realAddress, Bindings bindings)
- Overrides:
bindingsEmptyin classSimpleAddressManager
-
clear
public void clear()
- Specified by:
clearin interfaceAddressManager- Overrides:
clearin classSimpleAddressManager
-
getAddressMap
public AddressMap<Bindings> getAddressMap()
-
-