public static Future getFuture(boolean clear) throws SofaRpcException {
        RpcInvokeContext context = RpcInvokeContext.getContext();
        Future future = context.getFuture();
        if (future == null) {
            throw new SofaRpcException(RpcErrorType.CLIENT_UNDECLARED_ERROR,
                LogCodes.getLog(LogCodes.ERROR_RESPONSE_FUTURE_NULL,
                    Thread.currentThread()));
        }
        if (clear) {
            context.setFuture(null);
        }
        return future;
    }
public static Future getFuture ( boolean clear ) throws SofaRpcException { RpcInvokeContext context = RpcInvokeContext . getContext ( ) ; Future future = context . getFuture ( ) ; if ( future == null ) { throw new SofaRpcException ( RpcErrorType . CLIENT_UNDECLARED_ERROR , LogCodes . getLog ( LogCodes . ERROR_RESPONSE_FUTURE_NULL , Thread . currentThread ( ) ) ) ; } if ( clear ) { context . setFuture ( null ) ; } return future ; }
@param clear 是否清除线程上下文
@return 原生 Java Future 对象
@throws SofaRpcException 当前线程上下文没有值的时候