class RpcStartApplicationListener implements ApplicationContextAware,
                                        ApplicationListener<ContextRefreshedEvent>, Ordered {

    private final AtomicBoolean published = new AtomicBoolean(false);

    private final AtomicBoolean success   = new AtomicBoolean(false);

    private ApplicationContext  applicationContext;

    private boolean             enableAutoPublish;

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        if (applicationContext.equals(event.getApplicationContext()) && enableAutoPublish) {
            publishRpcStartEvent();
        }
    }

    public void publishRpcStartEvent() {<FILL_FUNCTION_BODY>}

    public boolean isSuccess() {
        return success.get();
    }

    public boolean isEnableAutoPublish() {
        return enableAutoPublish;
    }

    public void setEnableAutoPublish(boolean enableAutoPublish) {
        this.enableAutoPublish = enableAutoPublish;
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    @Override
    public int getOrder() {
        // must after ReadinessCheckListener
        return LOWEST_PRECEDENCE;
    }
}

        if (published.compareAndSet(false, true)) {
            //rpc 开始启动事件监听器
            applicationContext.publishEvent(new SofaBootRpcStartEvent(applicationContext));
            //rpc 启动完毕事件监听器
            applicationContext.publishEvent(new SofaBootRpcStartAfterEvent(applicationContext));
            success.compareAndSet(false, true);
        }
    
<no_super_class>