public static AsyncContext startAsync() throws IOException { Context<TarsServantRequest, TarsServantResponse> context = ContextManager.getContext(); AsyncContext aContext = new AsyncContext(context); context.response().asyncCallStart(); context.setAttribute(PORTAL_CAP_ASYNC_CONTEXT_ATTRIBUTE, aContext); return aContext; }
public void writeException(Throwable ex) throws IOException { TarsServantResponse response = this.context.response(); response.setRet(TarsHelper.SERVERUNKNOWNERR); response.setCause(ex); response.setResult(null); response.asyncCallEnd(); getCapHomeSkeleton().postInvokeCapHomeSkeleton(); Long startTime = this.context.getAttribute(Context.INTERNAL_START_TIME); TarsServantProcessor.printServiceFlowLog(flowLogger, this.context.request(), response.getRet(), (System.currentTimeMillis() - startTime.longValue()), ex.toString()); }
Context<TarsServantRequest, TarsServantResponse> context = ContextManager.getContext(); AsyncContext aContext = context.getAttribute(AsyncContext.PORTAL_CAP_ASYNC_CONTEXT_ATTRIBUTE); if (aContext != null) aContext.writeException(cause); } catch (Exception ex) { System.out.println("ERROR: " + ex.getMessage());
Context<TarsServantRequest, TarsServantResponse> context = ContextManager.getContext(); AsyncContext aContext = context.getAttribute(AsyncContext.PORTAL_CAP_ASYNC_CONTEXT_ATTRIBUTE); if (aContext != null) aContext.writeException(cause); } catch (Exception ex) { System.out.println("ERROR: " + ex.getMessage());
public void writeException(Throwable ex) throws IOException { TarsServantResponse response = this.context.response(); response.setRet(TarsHelper.SERVERUNKNOWNERR); response.setCause(ex); response.setResult(null); response.asyncCallEnd(); getCapHomeSkeleton().postInvokeCapHomeSkeleton(); Long startTime = this.context.getAttribute(Context.INTERNAL_START_TIME); TarsServantProcessor.printServiceFlowLog(flowLogger, this.context.request(), response.getRet(), (System.currentTimeMillis() - startTime.longValue()), ex.toString()); }
public static AsyncContext startAsync() throws IOException { Context<TarsServantRequest, TarsServantResponse> context = ContextManager.getContext(); AsyncContext aContext = new AsyncContext(context); context.response().asyncCallStart(); context.setAttribute(PORTAL_CAP_ASYNC_CONTEXT_ATTRIBUTE, aContext); return aContext; }
public void writeResult(Object result) throws IOException { TarsServantResponse response = this.context.response(); response.setRet(TarsHelper.SERVERSUCCESS); response.setCause(null); response.setResult(result); response.asyncCallEnd(); getCapHomeSkeleton().postInvokeCapHomeSkeleton(); Long startTime = this.context.getAttribute(Context.INTERNAL_START_TIME); TarsServantProcessor.printServiceFlowLog(flowLogger, this.context.request(), response.getRet(), (System.currentTimeMillis() - startTime.longValue()), ""); } }
public void writeResult(Object result) throws IOException { TarsServantResponse response = this.context.response(); response.setRet(TarsHelper.SERVERSUCCESS); response.setCause(null); response.setResult(result); response.asyncCallEnd(); getCapHomeSkeleton().postInvokeCapHomeSkeleton(); Long startTime = this.context.getAttribute(Context.INTERNAL_START_TIME); TarsServantProcessor.printServiceFlowLog(flowLogger, this.context.request(), response.getRet(), (System.currentTimeMillis() - startTime.longValue()), ""); } }