Interface IRequestHandlerBuilder
-
- All Superinterfaces:
Serializable
public interface IRequestHandlerBuilder extends Serializable
Builder for performing more than one cross scope conversation request and performing some logic when all have finished.- Since:
- 7.0.0
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
perform(Consumer<Map<UUID,IRequestResult>> onDone)
Starts all requests added viarequest
and calls the callback when all requests have finished.<T extends Serializable,R extends ICrossViewScopeRequest<T>>
UUIDrequest(R request, Duration timeout, ICrossViewScopeResponseConsumer<? super T> handler)
Adds a request (but does not start it yet).
-
-
-
Method Detail
-
request
<T extends Serializable,R extends ICrossViewScopeRequest<T>> UUID request(R request, Duration timeout, ICrossViewScopeResponseConsumer<? super T> handler)
Adds a request (but does not start it yet). SeeDesignerConversationBean.request(ICrossViewScopeRequest, Duration, ICrossViewScopeResponseConsumer, BackendViewPushContext)
for more details.- Type Parameters:
T
- Type of the requested data.R
- Type of the request.- Parameters:
request
- Request to send.timeout
- Timeout to set on the request. When no response is received within this time frame, the handler is invoked with an error.handler
- Handler to invoke when the request completes either successfully or erroneously.- Returns:
- The UUID for the request that can be used to retrieve the result in the
perform(Consumer)
method.
-
perform
boolean perform(Consumer<Map<UUID,IRequestResult>> onDone)
Starts all requests added viarequest
and calls the callback when all requests have finished.- Parameters:
onDone
- Callback invoked when all requests have finished (whether successful or not).- Returns:
true
if there are any pending responses,false
if all requests have been processed, such as when no handlers did respond to the request.
-
-