public interface ProtonReceiver extends ProtonLink<ProtonReceiver>
| Modifier and Type | Method and Description |
|---|---|
ProtonReceiver |
drain(long timeout,
Handler<AsyncResult<Void>> completionHandler)
Initiates a 'drain' of link credit from the remote sender.
|
ProtonReceiver |
flow(int credits)
Grants the given number of message credits to the sender.
|
int |
getPrefetch()
Get the current prefetch value.
|
ProtonReceiver |
handler(ProtonMessageHandler handler)
Sets the handler to process messages as they arrive.
|
boolean |
isAutoAccept()
Get whether the receiver is auto accepting.
|
ProtonReceiver |
setAutoAccept(boolean autoAccept)
Sets whether received deliveries should be automatically accepted (and settled) after the message handler runs for
them, if no other disposition has been applied during handling.
|
ProtonReceiver |
setPrefetch(int messages)
Sets the number of message credits the receiver grants and replenishes automatically as messages are delivered.
|
attachments, close, closeHandler, getCondition, getCredit, getDrain, getName, getQoS, getQueued, getRemoteCondition, getRemoteQoS, getRemoteSource, getRemoteTarget, getSession, getSource, getTarget, isOpen, open, openHandler, setCondition, setQoS, setSource, setTargetProtonReceiver handler(ProtonMessageHandler handler)
handler - the handler to process messagesProtonReceiver setPrefetch(int messages)
flow(int) as needed to manually grant credit.messages - the message prefetchint getPrefetch()
setPrefetch(int)ProtonReceiver setAutoAccept(boolean autoAccept)
autoAccept - whether deliveries should be auto accepted after handling if no disposition was appliedboolean isAutoAccept()
setAutoAccept(boolean)ProtonReceiver flow(int credits) throws IllegalStateException
setPrefetch(int) has been used to disable automatic prefetch credit handling.credits - the credits to flowIllegalStateException - if prefetch is non-zero, or an existing drain operation is not yet completeProtonReceiver drain(long timeout, Handler<AsyncResult<Void>> completionHandler) throws IllegalStateException, IllegalArgumentException
setPrefetch(int) has been used to disable automatic credit handling.timeout - the delay in milliseconds before which the drain attempt should be considered failed, or 0 for no timeout.completionHandler - handler called when credit hits 0 due to messages arriving, or a 'drain response' flowIllegalStateException - if prefetch is non-zero, or an existing drain operation is not yet completeIllegalArgumentException - if no completion handler is givenCopyright © 2017. All rights reserved.