public static void setReferenceContext(RpcReferenceContext referenceContext) {
        RpcInvokeContext.getContext().put(RemotingConstants.INVOKE_CTX_RPC_REF_CTX, referenceContext);
    }
get current service context

@param clear true: framework will clear the ThreadLocal when return
@return RPC Service Context, it can be null
core/api-compatible/src/main/java/com/alipay/sofa/rpc/api/context/RpcContextManager.java