Skip to content

Commit f856093

Browse files
committed
Sync ProtonJ2 with upstream
1 parent 821b565 commit f856093

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/main/qpid/org/apache/qpid/protonj2/client/ReceiverOptions.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,47 @@ public ReceiverOptions drainTimeout(long timeout, TimeUnit units) {
133133
return this;
134134
}
135135

136+
/**
137+
* Behavior when a message is delivered.
138+
*
139+
* <p>The default is to add the delivery to an internal queue, which can be polled with the <code>
140+
* receive</code> methods.
141+
*
142+
* <p>Setting a custom handler makes the <code>receive</code> methods ineffective.
143+
*
144+
* @param handler behavior for a new delivery
145+
* @return this {@link ReceiverOptions} instance.
146+
*/
136147
public ReceiverOptions handler(Consumer<Delivery> handler) {
137148
this.handler = handler;
138149
return this;
139150
}
140151

152+
/**
153+
* The configured message handler.
154+
*
155+
* @return the configured handler
156+
*/
141157
public Consumer<Delivery> handler() {
142158
return this.handler;
143159
}
144160

161+
/**
162+
* Callback when the receiver is closed / shut down.
163+
*
164+
* @param closeHandler close / shutdown handler
165+
* @return this {@link ReceiverOptions} instance.
166+
*/
145167
public ReceiverOptions closeHandler(Consumer<ClientException> closeHandler) {
146168
this.closeHandler = closeHandler;
147169
return this;
148170
}
149171

172+
/**
173+
* Configured close / shutdown handler.
174+
*
175+
* @return the configured handler
176+
*/
150177
public Consumer<ClientException> closeHandler() {
151178
return this.closeHandler;
152179
}

0 commit comments

Comments
 (0)