Package net.sf.eBus.client
Interface CancelRequestCallback
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface CancelRequestCallback
A class implementingEReplier
is not required to overrideEReplier.cancelRequest(EReplyFeed.ERequest, boolean)
. Instead, a Java lambda expression forCancelRequestCallback
may be passed toEReplyFeed.Builder.cancelRequestCallback(CancelRequestCallback)
and the lambda expression code will be executed when a request is canceled.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
call(EReplyFeed.ERequest request, boolean mayRespond)
With eBus release 5.6.0 a second, parameter is added:mayRespond
.
-
-
-
Method Detail
-
call
void call(EReplyFeed.ERequest request, boolean mayRespond)
With eBus release 5.6.0 a second, parameter is added:mayRespond
. Iftrue
the replier accepts the cancel request, the replier should respond with an appropriatereply message
(note that a newEReplyMessage.ReplyStatus
has been added:CANCELED
). If the replier rejects this cancel request then it may respond with aEReplyMessage
with a status ofCANCEL_REJECT
and a reason for the reject. does nothing and continues to work the request.if
mayRespond
isfalse
then this is a unilateral request cancellation. The request is shut down and no further replies will be accepted. However, in-flight replies posted prior to cancellation may still be delivered.request
matches the replier's open and advertisedfeed
. The associatedEReplyFeed
may be retrieved by callingEReplyFeed.ERequest.replier()
.- Parameters:
request
- cancel this request.mayRespond
- set totrue
if replier is allowed to respond to the cancel request. This allows the replier to accept or reject the request cancellation.
-
-