コード例 #1
0
 @Override
 public Object sendAndReceive(ClientRequest request, ClientConnection connection)
     throws Exception {
   final SerializationService ss = client.getSerializationService();
   connection.write(ss.toData(request));
   final Data data = connection.read();
   ClientResponse clientResponse = ss.toObject(data);
   Object response = ss.toObject(clientResponse.getResponse());
   if (response instanceof Throwable) {
     Throwable t = (Throwable) response;
     ExceptionUtil.fixRemoteStackTrace(t, Thread.currentThread().getStackTrace());
     throw new Exception(t);
   }
   return response;
 }
コード例 #2
0
 private boolean writeToConnection(ClientConnection connection, ClientMessage clientMessage) {
   clientMessage.addFlag(ClientMessage.BEGIN_AND_END_FLAGS);
   return connection.write(clientMessage);
 }