public class LocalRetryableExecution extends Object implements Runnable, OperationResponseHandler
OperationResponseHandler
set and it must return
response.
The retry will use the configured
GroupProperty.INVOCATION_MAX_RETRY_COUNT
and
GroupProperty.INVOCATION_RETRY_PAUSE
.Modifier and Type | Method and Description |
---|---|
boolean |
awaitCompletion(long timeout,
TimeUnit unit)
Causes the current thread to wait until the operation has finished the
thread is interrupted, or the specified
waiting time elapses.
|
Object |
getResponse()
The response of the operation execution.
|
void |
run() |
void |
sendResponse(Operation op,
Object response)
Sends a response.
|
public boolean awaitCompletion(long timeout, TimeUnit unit) throws InterruptedException
timeout
- the maximum time to waitunit
- the time unit of the timeout
argumenttrue
if the operation completed or the operation retry
count has been exceeded, else false
InterruptedException
- if the current thread is interrupted
while waitingpublic Object getResponse()
RetryableHazelcastException
or
the maximum number of retry counts was exceeded.
The response may be also null
if the operation has no response
or the operation has not completed yet.public void sendResponse(Operation op, Object response)
OperationResponseHandler
sendResponse
in interface OperationResponseHandler
op
- the operation that got executed.response
- the response of the operation that got executed.Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.