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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.activemq.artemis.protocol.amqp.proton.SenderController
SenderController.RejectingOutgoingMessageWriter
-
-
Field Summary
-
Fields inherited from interface org.apache.activemq.artemis.protocol.amqp.proton.SenderController
REJECTING_MESSAGE_WRITER
-
-
Constructor Summary
Constructors Constructor Description AMQPFederationEventDispatcher(AMQPFederation federation, AMQPSessionCallback session, org.apache.qpid.proton.engine.Sender sender)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAddressWatch(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.voidaddQueueWatch(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.voidafterAddAddress(org.apache.activemq.artemis.core.server.impl.AddressInfo addressInfo, boolean reload)voidafterAddBinding(org.apache.activemq.artemis.core.postoffice.Binding binding)voidclose()Handle close of the sever sender AMQP resources.voidclose(org.apache.qpid.proton.amqp.transport.ErrorCondition error)Called when the sender is being locally closed due to some error or forced shutdown due to resource deletion etc.org.apache.activemq.artemis.core.server.Consumerinit(ProtonServerSenderContext senderContext)Initialize sender controller state and handle open of AMQP sender resourcesvoidsendEvent(AMQPMessage event)Raw event send API that accepts anAMQPMessageinstance and routes it using the server post office instance.-
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
afterRemoveAddress, 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
afterRemoveBinding, beforeAddBinding, beforeRemoveBinding
-
Methods inherited from interface org.apache.activemq.artemis.protocol.amqp.proton.SenderController
selectOutgoingMessageWriter
-
-
-
-
Constructor Detail
-
AMQPFederationEventDispatcher
public AMQPFederationEventDispatcher(AMQPFederation federation, AMQPSessionCallback session, org.apache.qpid.proton.engine.Sender sender)
-
-
Method Detail
-
sendEvent
public void sendEvent(AMQPMessage event) throws Exception
Raw event send API that accepts anAMQPMessageinstance 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:SenderControllerInitialize sender controller state and handle open of AMQP sender resources- Specified by:
initin interfaceSenderController- 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()
Description copied from interface:SenderControllerHandle close of the sever sender AMQP resources.- Specified by:
closein interfaceSenderController
-
close
public void close(org.apache.qpid.proton.amqp.transport.ErrorCondition error)
Description copied from interface:SenderControllerCalled 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:
closein interfaceSenderController- 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:
afterAddAddressin interfaceActiveMQServerAddressPlugin- Throws:
ActiveMQException
-
afterAddBinding
public void afterAddBinding(org.apache.activemq.artemis.core.postoffice.Binding binding) throws ActiveMQException- Specified by:
afterAddBindingin interfaceActiveMQServerBindingPlugin- Throws:
ActiveMQException
-
-