Class ClientSender
- java.lang.Object
-
- org.apache.qpid.protonj2.client.impl.ClientLinkType<LinkType,Sender>
-
- org.apache.qpid.protonj2.client.impl.ClientSenderLinkType<Sender>
-
- org.apache.qpid.protonj2.client.impl.ClientSender
-
- All Implemented Interfaces:
AutoCloseable
,Link<Sender>
,Sender
public final class ClientSender extends ClientSenderLinkType<Sender> implements Sender
Proton based AMQP Sender
-
-
Field Summary
-
Fields inherited from class org.apache.qpid.protonj2.client.impl.ClientSenderLinkType
protonSender
-
Fields inherited from class org.apache.qpid.protonj2.client.impl.ClientLinkType
closed, CLOSED_UPDATER, closeFuture, executor, failureCause, linkId, linkRemotelyClosedHandler, openFuture, remoteSource, remoteTarget, session
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
linkSpecificCleanupHandler(ClientException failureCause)
protected void
linkSpecificLocalCloseHandler()
protected void
linkSpecificLocalOpenHandler()
protected void
linkSpecificRemoteCloseHandler()
protected void
linkSpecificRemoteOpenHandler()
protected void
recreateLinkForReconnect()
protected Sender
self()
Tracker
send(Message<?> message)
Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit.Tracker
send(Message<?> message, Map<String,Object> deliveryAnnotations)
Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit.Tracker
trySend(Message<?> message)
Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt.Tracker
trySend(Message<?> message, Map<String,Object> deliveryAnnotations)
Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt.-
Methods inherited from class org.apache.qpid.protonj2.client.impl.ClientSenderLinkType
protonLink
-
Methods inherited from class org.apache.qpid.protonj2.client.impl.ClientLinkType
address, checkClosedOrFailed, client, close, close, closeAsync, closeAsync, connection, desiredCapabilities, detach, detach, detachAsync, detachAsync, handleEngineShutdown, handleLocalCloseOrDetach, handleLocalOpen, handleParentEndpointClosed, handleRemoteCloseOrDetach, handleRemoteOpen, immediateLinkShutdown, notClosedOrFailed, notClosedOrFailed, offeredCapabilities, openFuture, properties, session, source, target, waitForOpenToComplete
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.qpid.protonj2.client.Link
address, client, close, close, closeAsync, closeAsync, connection, desiredCapabilities, detach, detach, detachAsync, detachAsync, offeredCapabilities, openFuture, properties, session, source, target
-
-
-
-
Method Detail
-
send
public Tracker send(Message<?> message) throws ClientException
Description copied from interface:Sender
Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit.- Specified by:
send
in interfaceSender
- Parameters:
message
- theMessage
to send.- Returns:
- the
Tracker
for the message delivery - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
send
public Tracker send(Message<?> message, Map<String,Object> deliveryAnnotations) throws ClientException
Description copied from interface:Sender
Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.- Specified by:
send
in interfaceSender
- Parameters:
message
- theMessage
to send.deliveryAnnotations
- the delivery annotations that should be included in the sentMessage
.- Returns:
- the
Tracker
for the message delivery - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
trySend
public Tracker trySend(Message<?> message) throws ClientException
Description copied from interface:Sender
Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt.- Specified by:
trySend
in interfaceSender
- Parameters:
message
- theMessage
to send if credit is available.- Returns:
- the
Tracker
for the message delivery or null if no credit for sending. - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
trySend
public Tracker trySend(Message<?> message, Map<String,Object> deliveryAnnotations) throws ClientException
Description copied from interface:Sender
Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.- Specified by:
trySend
in interfaceSender
- Parameters:
message
- theMessage
to send if credit is available.deliveryAnnotations
- the delivery annotations that should be included in the sentMessage
.- Returns:
- the
Tracker
for the message delivery or null if no credit for sending. - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
self
protected Sender self()
- Specified by:
self
in classClientLinkType<Sender,Sender>
-
linkSpecificLocalOpenHandler
protected void linkSpecificLocalOpenHandler()
- Specified by:
linkSpecificLocalOpenHandler
in classClientLinkType<Sender,Sender>
-
recreateLinkForReconnect
protected void recreateLinkForReconnect()
- Specified by:
recreateLinkForReconnect
in classClientLinkType<Sender,Sender>
-
linkSpecificCleanupHandler
protected void linkSpecificCleanupHandler(ClientException failureCause)
- Specified by:
linkSpecificCleanupHandler
in classClientLinkType<Sender,Sender>
-
linkSpecificLocalCloseHandler
protected void linkSpecificLocalCloseHandler()
- Specified by:
linkSpecificLocalCloseHandler
in classClientLinkType<Sender,Sender>
-
linkSpecificRemoteOpenHandler
protected void linkSpecificRemoteOpenHandler()
- Specified by:
linkSpecificRemoteOpenHandler
in classClientLinkType<Sender,Sender>
-
linkSpecificRemoteCloseHandler
protected void linkSpecificRemoteCloseHandler()
- Specified by:
linkSpecificRemoteCloseHandler
in classClientLinkType<Sender,Sender>
-
-