public void HandleResult(IList <MemoryStream> result) { var bbi = new ByteBufferInputStream(result); var input = new BinaryDecoder(bbi); if (!requestor.ReadHandshake(input)) { // Resend the handshake and return var handshake = new RpcRequest(request); IList <MemoryStream> requestBytes = handshake.GetBytes(requestor.Local, requestor); var transceiverCallback = new TransceiverCallback <T>(requestor, handshake, callback, local); requestor.Transceiver.Transceive(requestBytes, transceiverCallback); return; } // Read response; invoke callback var response = new Response(requestor, request, input); try { Object responseObject; try { responseObject = response.getResponse(); } catch (Exception e) { if (callback != null) { callback.HandleException(e); } return; } if (callback != null) { callback.HandleResult((T)responseObject); } } catch { //LOG.error("Error in callback handler: " + t, t); } }
public virtual void HandleException(Exception exception) { Error = exception; latch.Signal(); if (chainedCallback != null) { chainedCallback.HandleException(exception); } }
public void Transceive(IList<MemoryStream> request, ICallback<IList<MemoryStream>> callback) { if (request == null) throw new ArgumentNullException("request"); try { IList<MemoryStream> response = Transceive(request); callback.HandleResult(response); } catch (IOException e) { callback.HandleException(e); } }
public void Transceive(IList <MemoryStream> request, ICallback <IList <MemoryStream> > callback) { if (request == null) { throw new ArgumentNullException("request"); } try { IList <MemoryStream> response = Transceive(request); callback.HandleResult(response); } catch (IOException e) { callback.HandleException(e); } }