class CloudDiscoveryServiceWaterImpl extends TimerTask implements CloudDiscoveryService {
    static final Logger log = LoggerFactory.getLogger(CloudDiscoveryServiceWaterImpl.class);

    //String checkPathDefault;
    private String alarmMobile;
    private long refreshInterval;
    private boolean unstable;

    public CloudDiscoveryServiceWaterImpl(CloudProps cloudProps) {
        unstable = Solon.cfg().isFilesMode()
                || Solon.cfg().isDriftMode();
        //checkPathDefault = WaterProps.instance.getDiscoveryHealthCheckPath();
        alarmMobile =cloudProps.getAlarm();
        refreshInterval = IntervalUtils.getInterval(cloudProps.getDiscoveryRefreshInterval("5s"));
    }

    /**
     * 健康检测刷新间隔时间（仅当isFilesMode时有效）
     */
    public long getRefreshInterval() {
        return refreshInterval;
    }

    @Override
    public void run() {
        //外面5s跑一次
        try {
            //主动刷新健康
            if (Solon.cfg().isFilesMode()) {
                runByFile();
            }

        } catch (Throwable e) {
            log.warn(e.getMessage(), e);
        }
    }

    /**
     * 文件模式运行时
     * */
    private void runByFile() {
        if (Utils.isNotEmpty(Solon.cfg().appName())) {
            try {
                for (Signal signal : Solon.app().signals()) {
                    Instance instance = Instance.localNew(signal);
                    register(Solon.cfg().appGroup(), instance);
                }
            } catch (Throwable ex) {

            }

            try {
                observerMap.forEach((k, v) -> {
                    onUpdate(v.group, v.service);
                });
            } catch (Throwable ex) {

            }
        }
    }


    @Override
    public void register(String group, Instance instance) {
        String meta = null;
        if (instance.meta() != null && instance.meta().size() > 0) {
            meta = ONode.stringify(instance.meta());
        }

        String protocol = Utils.annoAlias(instance.protocol(), "http");
        String code_location = Solon.app().sourceLocation().getPath();
        String checkPath;
        if (protocol.startsWith("http")) {
            checkPath = HealthHandler.HANDLER_PATH;
        } else {
            checkPath = instance.uri();
        }


        //被动接收检测
        WaterClient.Registry.register(Solon.cfg().appGroup(), instance.service(), instance.address(), meta, checkPath, 0, alarmMobile, code_location, unstable);
    }

    @Override
    public void registerState(String group, Instance instance, boolean health) {
        String meta = null;
        if (instance.meta() != null) {
            meta = ONode.stringify(instance.meta());
        }

        WaterClient.Registry.set(group, instance.service(), instance.address(), meta, health);
    }

    @Override
    public void deregister(String group, Instance instance) {
        String meta = null;
        if (instance.meta() != null) {
            meta = ONode.stringify(instance.meta());
        }

        WaterClient.Registry.unregister(group, instance.service(), instance.address(), meta);
    }

    @Override
    public Discovery find(String group, String service) {<FILL_FUNCTION_BODY>}

    Map<String, String> serviceMap = new HashMap<>();
    Map<CloudDiscoveryHandler, CloudDiscoveryObserverEntity> observerMap = new HashMap<>();

    @Override
    public void attention(String group, String service, CloudDiscoveryHandler observer) {
        observerMap.put(observer, new CloudDiscoveryObserverEntity(group, service, observer));
        serviceMap.put(service, service);
    }

    public void onUpdate(String group, String service) {
        if (serviceMap.containsKey(service)) {
            Discovery discovery = find(group, service);

            observerMap.forEach((k, v) -> {
                if (service.equals(v.service)) {
                    v.handle(discovery);
                }
            });
        }
    }
}

        Instance instance = Instance.local();

        DiscoverM d1 = WaterClient.Registry.discover(group, service, instance.service(), instance.address());
        return ConvertUtil.from(service, d1);
    
<methods>public boolean cancel() ,public abstract void run() ,public long scheduledExecutionTime() <variables>static final int CANCELLED,static final int EXECUTED,static final int SCHEDULED,static final int VIRGIN,final java.lang.Object lock,long nextExecutionTime,long period,int state