public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; updateAllOutput_result result = new updateAllOutput_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } };
@Nullable private static TBase<?, ?> getResult(AsyncProcessFunction<?, ?, ?> asyncFunc) { return getResult0(Type.ASYNC, asyncFunc.getClass(), asyncFunc.getMethodName()); }
public void onComplete(Void o) { updateOutput_result result = new updateOutput_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) {
public boolean process(final AsyncFrameBuffer fb) throws TException { TProtocolUtil.skip(in, TType.STRUCT); in.readMessageEnd(); if (!fn.isOneway()) { TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); out.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); x.write(out); out.writeMessageEnd(); out.getTransport().flush(); TBase args = fn.getEmptyArgsInstance(); } catch (TProtocolException e) { in.readMessageEnd(); if (!fn.isOneway()) { TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); out.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); x.write(out); if (fn.isOneway()) { fb.responseReady(); AsyncMethodCallback resultHandler = fn.getResultHandler(fb, msg.seqid); try { fn.start(iface, args, resultHandler); } catch (Exception e) { resultHandler.onError(e);
/** * Returns a new empty arguments instance. */ public TBase<?, ?> newArgs() { if (isAsync()) { return asyncFunc().getEmptyArgsInstance(); } else { return syncFunc().getEmptyArgsInstance(); } }
private static void invokeAsynchronously( Object impl, ThriftFunction func, TBase<?, ?> args, DefaultRpcResponse reply) throws TException { final AsyncProcessFunction<Object, TBase<?, ?>, Object> f = func.asyncFunc(); if (func.isOneWay()) { f.start(impl, args, ONEWAY_CALLBACK); reply.complete(null); } else { f.start(impl, args, new AsyncMethodCallback<Object>() { @Override public void onComplete(Object response) { reply.complete(response); } @Override public void onError(Exception e) { reply.completeExceptionally(e); } }); } }
public void onComplete(Void o) { addAngularObject_result result = new addAngularObject_result(); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) {
/** * Returns a new empty arguments instance. */ public TBase<?, ?> newArgs() { if (isAsync()) { return asyncFunc().getEmptyArgsInstance(); } else { return syncFunc().getEmptyArgsInstance(); } }
private static void invokeAsynchronously( Object impl, ThriftFunction func, TBase<?, ?> args, DefaultRpcResponse reply) throws TException { final AsyncProcessFunction<Object, TBase<?, ?>, Object> f = func.asyncFunc(); f.start(impl, args, new AsyncMethodCallback<Object>() { @Override public void onComplete(Object response) { if (func.isOneWay()) { reply.complete(null); } else { reply.complete(response); } } @Override public void onError(Exception e) { reply.completeExceptionally(e); } }); }
public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; addAngularObject_result result = new addAngularObject_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } };
public void onComplete(List<String> o) { getAllResources_result result = new getAllResources_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) {
private static TBase<?, ?> getArgs(AsyncProcessFunction<?, ?, ?> asyncFunc) { return getArgs0(Type.ASYNC, asyncFunc.getClass(), asyncFunc.getMethodName()); }
/** * Returns a new empty arguments instance. */ public TBase<?, ?> newArgs() { if (isAsync()) { return asyncFunc().getEmptyArgsInstance(); } else { return syncFunc().getEmptyArgsInstance(); } }
private static void invokeAsynchronously( Object impl, ThriftFunction func, TBase<?, ?> args, DefaultRpcResponse reply) throws TException { final AsyncProcessFunction<Object, TBase<?, ?>, Object> f = func.asyncFunc(); if (func.isOneWay()) { f.start(impl, args, ONEWAY_CALLBACK); reply.complete(null); } else { f.start(impl, args, new AsyncMethodCallback<Object>() { @Override public void onComplete(Object response) { reply.complete(response); } @Override public void onError(Exception e) { reply.completeExceptionally(e); } }); } }
public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; getResource_result result = new getResource_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } };
public void onComplete(ByteBuffer o) { getResource_result result = new getResource_result(); result.success = o; try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; } catch (Exception e) { LOGGER.error("Exception writing to internal frame buffer", e); } fb.close(); } public void onError(Exception e) {
private static TFieldIdEnum[] getArgFields(AsyncProcessFunction<?, ?, ?> asyncFunc) { return getArgFields0(Type.ASYNC, asyncFunc.getClass(), asyncFunc.getMethodName()); }
/** * Returns a new empty arguments instance. */ public TBase<?, ?> newArgs() { if (isAsync()) { return asyncFunc().getEmptyArgsInstance(); } else { return syncFunc().getEmptyArgsInstance(); } }
private static void invokeAsynchronously( Object impl, ThriftFunction func, TBase<?, ?> args, DefaultRpcResponse reply) throws TException { final AsyncProcessFunction<Object, TBase<?, ?>, Object> f = func.asyncFunc(); if (func.isOneWay()) { f.start(impl, args, ONEWAY_CALLBACK); reply.complete(null); } else { f.start(impl, args, new AsyncMethodCallback<Object>() { @Override public void onComplete(Object response) { reply.complete(response); } @Override public void onError(Exception e) { reply.completeExceptionally(e); } }); } }
public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; createInterpreter_result result = new createInterpreter_result(); { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); return; } catch (Exception ex) { LOGGER.error("Exception writing to internal frame buffer", ex); } fb.close(); } };