class RpcServer extends NettyServer implements ApplicationContextAware, InitializingBean, DisposableBean {
    public RpcServer(String serverAddress, String registryAddress) {
        super(serverAddress, registryAddress);
    }

    @Override
    public void setApplicationContext(ApplicationContext ctx) throws BeansException {<FILL_FUNCTION_BODY>}

    @Override
    public void afterPropertiesSet() throws Exception {
        super.start();
    }

    @Override
    public void destroy() {
        super.stop();
    }
}

        Map<String, Object> serviceBeanMap = ctx.getBeansWithAnnotation(NettyRpcService.class);
        if (MapUtils.isNotEmpty(serviceBeanMap)) {
            for (Object serviceBean : serviceBeanMap.values()) {
                NettyRpcService nettyRpcService = serviceBean.getClass().getAnnotation(NettyRpcService.class);
                String interfaceName = nettyRpcService.value().getName();
                String version = nettyRpcService.version();
                super.addService(interfaceName, version, serviceBean);
            }
        }
    
<methods>public void <init>(java.lang.String, java.lang.String) ,public void addService(java.lang.String, java.lang.String, java.lang.Object) ,public void start() ,public void stop() <variables>private static final Logger logger,private java.lang.String serverAddress,private Map<java.lang.String,java.lang.Object> serviceMap,private com.netty.rpc.server.registry.ServiceRegistry serviceRegistry,private java.lang.Thread thread