protected Long getCorrelationIdFromReply(final FudgeMsg reply) {
return reply.getLong(CacheMessage.CORRELATION_ID_KEY);
}
private <Request extends CacheMessage, Response extends CacheMessage> Response sendMessage(final Request request, final Class<Response> responseClass) {
final FudgeSerializer scontext = new FudgeSerializer(getMessageSender().getFudgeContext());
final long correlationId = getNextCorrelationId();
request.setCorrelationId(correlationId);
final FudgeMsg responseMsg = sendRequestAndWaitForResponse(FudgeSerializer.addClassHeader(scontext.objectToFudgeMsg(request), request.getClass(), CacheMessage.class),
correlationId);
final FudgeDeserializer dcontext = new FudgeDeserializer(getMessageSender().getFudgeContext());
final Response response = dcontext.fudgeMsgToObject(responseClass, responseMsg);
return response;
}