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 SenderController
SenderController.RejectingOutgoingMessageWriter -
Field Summary
Fields inherited from interface SenderController
REJECTING_MESSAGE_WRITER -
Constructor Summary
ConstructorsConstructorDescriptionAMQPFederationEventDispatcher(AMQPFederation federation, AMQPSessionCallback session, org.apache.qpid.proton.engine.Sender sender) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAddressWatch(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(boolean remoteClose) Handle close of the sever sender AMQP resources either from remote link detach or local close usually due to connection drop.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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ActiveMQServerAddressPlugin
afterRemoveAddress, afterUpdateAddress, beforeAddAddress, beforeRemoveAddress, beforeUpdateAddressMethods inherited from interface ActiveMQServerBasePlugin
init, registered, setInit, unregisteredMethods inherited from interface ActiveMQServerBindingPlugin
afterRemoveBinding, beforeAddBinding, beforeRemoveBindingMethods inherited from interface SenderController
selectOutgoingMessageWriter
-
Constructor Details
-
AMQPFederationEventDispatcher
public AMQPFederationEventDispatcher(AMQPFederation federation, AMQPSessionCallback session, org.apache.qpid.proton.engine.Sender sender)
-
-
Method Details
-
sendEvent
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(boolean remoteClose) Description copied from interface:SenderControllerHandle close of the sever sender AMQP resources either from remote link detach or local close usually due to connection drop.- Specified by:
closein interfaceSenderController- Parameters:
remoteClose- Indicates if the remote link detached the sender or local action closed it.
-
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
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
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
-