use of com.hazelcast.spi.impl.operationservice.impl.responses.Response in project hazelcast by hazelcast.
the class InboundResponseHandler method handle.
@Override
public void handle(Packet packet) throws Exception {
Response response = serializationService.toObject(packet);
Address sender = packet.getConn().getEndPoint();
try {
if (response instanceof NormalResponse) {
NormalResponse normalResponse = (NormalResponse) response;
notifyNormalResponse(normalResponse.getCallId(), normalResponse.getValue(), normalResponse.getBackupAcks(), sender);
} else if (response instanceof BackupAckResponse) {
notifyBackupComplete(response.getCallId());
} else if (response instanceof CallTimeoutResponse) {
notifyCallTimeout(response.getCallId(), sender);
} else if (response instanceof ErrorResponse) {
ErrorResponse errorResponse = (ErrorResponse) response;
notifyErrorResponse(errorResponse.getCallId(), errorResponse.getCause(), sender);
} else {
logger.severe("Unrecognized response: " + response);
}
} catch (Throwable e) {
logger.severe("While processing response...", e);
}
}
use of com.hazelcast.spi.impl.operationservice.impl.responses.Response in project hazelcast by hazelcast.
the class OutboundResponseHandler method sendResponse.
@Override
public void sendResponse(Operation operation, Object obj) {
Response response = toResponse(operation, obj);
if (!send(response, operation.getCallerAddress())) {
Connection conn = operation.getConnection();
logger.warning("Cannot send response: " + obj + " to " + conn.getEndPoint() + ". " + operation);
}
}
Aggregations