Interface Sender

All Superinterfaces:
Endpoint, Link

public interface Sender
extends Link


Method Summary
 void abort()
          Abort the current delivery.
 boolean advance()
          Attempts to advance the current delivery.
 void drained()
 void offer(int credits)
          indicates pending deliveries
 int send(byte[] bytes, int offset, int length)
          Sends some data for the current delivery.
Methods inherited from interface org.apache.qpid.proton.engine.Link
current, delivery, delivery, getCredit, getName, getQueued, getReceiverSettleMode, getRemoteReceiverSettleMode, getRemoteSenderSettleMode, getRemoteSource, getRemoteTarget, getSenderSettleMode, getSession, getSource, getTarget, getUnsettled, next, setReceiverSettleMode, setRemoteSenderSettleMode, setSenderSettleMode, setSource, setTarget, unsettled
Methods inherited from interface org.apache.qpid.proton.engine.Endpoint
close, free, getCondition, getContext, getLocalState, getRemoteCondition, getRemoteState, open, setCondition, setContext

Method Detail


void offer(int credits)
indicates pending deliveries

credits - the number of pending deliveries


int send(byte[] bytes,
         int offset,
         int length)
Sends some data for the current delivery. The application may call this method multiple times for the same delivery.

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.


void abort()
Abort the current delivery. Note "pn_link_abort" is commented out in the .h


void drained()


boolean advance()
Attempts 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. Informs the sender that all the bytes of the current Delivery have been written. The application must call this method in order for the delivery to be considered complete.

Specified by:
advance in interface Link
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:
TODO fully state the rules regarding when you have to call this method, what happens if you don't call it before creating another delivery etc.