Class AMQPBridgeSender
java.lang.Object
org.apache.activemq.artemis.protocol.amqp.connect.bridge.AMQPBridgeSender
- All Implemented Interfaces:
Closeable, AutoCloseable
- Direct Known Subclasses:
AMQPBridgeToAddressSender, AMQPBridgeToQueueSender
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AMQPBridgeManagerprotected final AtomicBooleanprotected final AMQPBridgeSenderConfigurationprotected final AMQPConnectionContextprotected booleanprotected static final AtomicLongprotected final AMQPBridgeMetrics.SenderMetricsprotected final AMQPBridgePolicyprotected final AMQPBridgeToPolicyManagerprotected org.apache.qpid.proton.engine.Senderprotected Consumer<AMQPBridgeSender> protected Consumer<AMQPBridgeSender> protected ProtonServerSenderContextprotected final AMQPBridgeSenderInfoprotected final AMQPSessionContext -
Constructor Summary
ConstructorsConstructorDescriptionAMQPBridgeSender(AMQPBridgeToPolicyManager policyManager, AMQPBridgeSenderConfiguration configuration, AMQPSessionContext session, AMQPBridgeSenderInfo senderInfo, AMQPBridgeMetrics.SenderMetrics metrics) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()Close the AMQP bridge sender instance and cleans up its resources.protected abstract voidHandles the create of the actual AMQP sender link on the connection thread.final AMQPBridgeManagerReturns theAMQPBridgeManagerthat this sender operates under.Returns theAMQPBridgeSenderConfigurationthat this sender operates under.Returns the policy that this sender was configured to use.Returns theAMQPBridgeToPolicyManagerthat this sender operates under.protected final org.apache.qpid.proton.amqp.Symbol[]final AMQPBridgeSenderInfoReturns an information object that defines the characteristics of theAMQPBridgeSender.voidCalled to initialize the AMQP bridge sender which will trigger an asynchronous task to attach the link and handle all setup sender and eventually start the flow of credit to the remote.booleanisClosed()final booleanReturnstrueif the receiver has previously been initialized.protected final booleanremoteLinkClosedInterceptor(org.apache.qpid.proton.engine.Link link) final AMQPBridgeSendersetRemoteClosedHandler(Consumer<AMQPBridgeSender> handler) Provides and event point for notification of the sender having been closed by the remote.final AMQPBridgeSendersetRemoteOpenHandler(Consumer<AMQPBridgeSender> handler) Provides and event point for notification of the sender having been opened successfully by the remote.
-
Field Details
-
LINK_SEQUENCE_ID
-
bridgeManager
-
policyManager
-
configuration
-
senderInfo
-
policy
-
connection
-
session
-
metrics
-
closed
-
senderContext
-
protonSender
protected org.apache.qpid.proton.engine.Sender protonSender -
initialized
protected volatile boolean initialized -
remoteOpenHandler
-
remoteCloseHandler
-
-
Constructor Details
-
AMQPBridgeSender
public AMQPBridgeSender(AMQPBridgeToPolicyManager policyManager, AMQPBridgeSenderConfiguration configuration, AMQPSessionContext session, AMQPBridgeSenderInfo senderInfo, AMQPBridgeMetrics.SenderMetrics metrics)
-
-
Method Details
-
isClosed
public boolean isClosed() -
isInitialized
public final boolean isInitialized()Returnstrueif the receiver has previously been initialized.- Returns:
trueif the receiver has previously been initialized
-
initialize
public void initialize()Called to initialize the AMQP bridge sender which will trigger an asynchronous task to attach the link and handle all setup sender and eventually start the flow of credit to the remote. This method should be called once after the basic configuration of the sender is complete and should not be called again after that. -
close
public final void close()Close the AMQP bridge sender instance and cleans up its resources. This method should not block and the actual resource shutdown work should occur asynchronously.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getPolicy
Returns the policy that this sender was configured to use.- Returns:
- the policy that this sender was configured to use
-
getBridgeManager
Returns theAMQPBridgeManagerthat this sender operates under.- Returns:
- the
AMQPBridgeManagerthat this sender operates under
-
getPolicyManager
Returns theAMQPBridgeToPolicyManagerthat this sender operates under.- Returns:
- the
AMQPBridgeToPolicyManagerthat this sender operates under
-
getConfiguration
Returns theAMQPBridgeSenderConfigurationthat this sender operates under.- Returns:
- the
AMQPBridgeSenderConfigurationthat this sender operates under
-
getSenderInfo
Returns an information object that defines the characteristics of theAMQPBridgeSender.- Returns:
- an information object that defines the characteristics of the
AMQPBridgeSender
-
setRemoteOpenHandler
Provides and event point for notification of the sender having been opened successfully by the remote. This handler will not be called if the remote rejects the link attach and aDetachis expected to follow.- Parameters:
handler- The handler that will be invoked when the remote opens this sender.- Returns:
- this sender instance.
-
setRemoteClosedHandler
Provides and event point for notification of the sender having been closed by the remote.- Parameters:
handler- The handler that will be invoked when the remote closes this sender.- Returns:
- this sender instance.
-
doCreateSender
protected abstract void doCreateSender()Handles the create of the actual AMQP sender link on the connection thread. -
getRemoteTerminusCapabilities
protected final org.apache.qpid.proton.amqp.Symbol[] getRemoteTerminusCapabilities() -
remoteLinkClosedInterceptor
protected final boolean remoteLinkClosedInterceptor(org.apache.qpid.proton.engine.Link link)
-