Class SenderImpl
java.lang.Object
org.apache.qpid.proton.engine.impl.EndpointImpl
org.apache.qpid.proton.engine.impl.LinkImpl
org.apache.qpid.proton.engine.impl.SenderImpl
- All Implemented Interfaces:
Endpoint,Extendable,Link,ProtonJEndpoint,Sender
-
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Abort the current delivery.booleanadvance()Attempts to advance the current delivery.intvoidoffer(int credits) indicates pending deliveriesintsend(byte[] bytes, int offset, int length) Sends some data for the current delivery.intsend(ReadableBuffer buffer) Sends some data for the current delivery.intsendNoCopy(ReadableBuffer buffer) Sends data to the current delivery attempting not to copy the data unless a previous send has already added data to the Delivery in which case a copy may occur depending on the implementation.voidsetCredit(int credit) Methods inherited from class org.apache.qpid.proton.engine.impl.LinkImpl
addCredit, current, delivery, delivery, detach, detached, drained, getConnectionImpl, getCredit, getDesiredCapabilities, getDrain, getMaxMessageSize, getName, getOfferedCapabilities, getProperties, getQueued, getReceiverSettleMode, getRemoteDesiredCapabilities, getRemoteMaxMessageSize, getRemoteOfferedCapabilities, getRemoteProperties, getRemoteReceiverSettleMode, getRemoteSenderSettleMode, getRemoteSource, getRemoteTarget, getSenderSettleMode, getSession, getSource, getTarget, getUnsettled, head, next, setDesiredCapabilities, setMaxMessageSize, setOfferedCapabilities, setProperties, setReceiverSettleMode, setRemoteSenderSettleMode, setSenderSettleMode, setSource, setTargetMethods inherited from class org.apache.qpid.proton.engine.impl.EndpointImpl
attachments, close, free, getCondition, getContext, getLocalState, getRemoteCondition, getRemoteState, open, setCondition, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.qpid.proton.engine.Endpoint
close, free, getCondition, getContext, getLocalState, getRemoteCondition, getRemoteState, open, setCondition, setContextMethods inherited from interface org.apache.qpid.proton.engine.Extendable
attachmentsMethods inherited from interface org.apache.qpid.proton.engine.Link
current, delivery, delivery, detach, detached, drained, getCredit, getDesiredCapabilities, getDrain, getMaxMessageSize, getName, getOfferedCapabilities, getProperties, getQueued, getReceiverSettleMode, getRemoteDesiredCapabilities, getRemoteMaxMessageSize, getRemoteOfferedCapabilities, getRemoteProperties, getRemoteReceiverSettleMode, getRemoteSenderSettleMode, getRemoteSource, getRemoteTarget, getSenderSettleMode, getSession, getSource, getTarget, getUnsettled, head, next, setDesiredCapabilities, setMaxMessageSize, setOfferedCapabilities, setProperties, setReceiverSettleMode, setRemoteSenderSettleMode, setSenderSettleMode, setSource, setTarget
-
Method Details
-
offer
public void offer(int credits) Description copied from interface:Senderindicates pending deliveries -
send
public int send(byte[] bytes, int offset, int length) Description copied from interface:SenderSends some data for the current delivery. The application may call this method multiple times for the same delivery.- Specified by:
sendin interfaceSender- Parameters:
bytes- the byte array containing the data to be sent.offset- the offset into the given array to start reading.length- the number of bytes to read from the given byte array.- Returns:
- the number of bytes accepted TODO Proton-j current copies all the bytes it has been given so the return value will always be length. Should this be changed? How does Proton-c behave? What should the application do if the number of bytes accepted is smaller than length.
-
send
Description copied from interface:SenderSends some data for the current delivery. The application may call this method multiple times for the same delivery. -
sendNoCopy
Description copied from interface:SenderSends data to the current delivery attempting not to copy the data unless a previous send has already added data to the Delivery in which case a copy may occur depending on the implementation.Care should be taken when passing ReadableBuffer instances that wrapped pooled bytes as the send does not mean the data will be sent immediately when the transport is flushed so the pooled bytes could be held for longer than expected.
- Specified by:
sendNoCopyin interfaceSender- Parameters:
buffer- An immutable ReadableBuffer that can be held until the next transport flush.- Returns:
- the number of bytes read from the provided buffer.
-
abort
public void abort()Description copied from interface:SenderAbort the current delivery. Note "pn_link_abort" is commented out in the .h -
advance
public boolean advance()Description copied from interface:LinkAttempts to advance the current delivery. Advances it to the next delivery if one exists, else null. The behaviour of this method is different for senders and receivers.- Specified by:
advancein interfaceLink- Specified by:
advancein interfaceSender- Overrides:
advancein classLinkImpl- Returns:
- true if it can advance, false if it cannot TODO document the meaning of the return value more fully. Currently Senderimpl only returns false if there is no current delivery
- See Also:
-
setCredit
public void setCredit(int credit) -
getRemoteCredit
public int getRemoteCredit()Description copied from interface:LinkReturns a [locally generated] view of credit at the remote peer by considering the current linkcreditcount as well as the effect of any locallyqueuedmessages.- Specified by:
getRemoteCreditin interfaceLink- Returns:
- view of effective remote credit
-