    def refreshEndpoints(self):
        '''
        @brief: 刷新服务器列表
        @return: 新的服务列表
        @rtype: EndPointInfo列表
        '''
        tarsLogger.debug('AdapterProxyManager:refreshEndpoints')
        if self.__isDirectProxy:
            return

        interval = self.__comm.getProperty(
            'refresh-endpoint-interval', float) / 1000
        locator = self.__comm.getProperty('locator')

        if '@' not in locator:
            raise exception.TarsRegistryException(
                'locator is not valid: ' + locator)

        now = time.time()
        last = self.__lastFreshTime
        epSize = len(self.__adps)
        if last + interval < now or (epSize <= 0 and last + 2 < now):
            queryFPrx = self.__comm.stringToProxy(QueryFProxy, locator)
            # 首次访问是同步调用，之后访问是异步调用
            if epSize == 0 or last == 0:
                ret, activeEps, inactiveEps = (
                    queryFPrx.findObjectById4All(self.__object.name()))
                # 目前只支持TCP
                eplist = [EndPointInfo(x.host, x.port, x.timeout, x.weight, x.weightType)
                          for x in activeEps if ret == 0 and x.istcp]
                ieplist = [EndPointInfo(x.host, x.port, x.timeout, x.weight, x.weightType)
                           for x in inactiveEps if ret == 0 and x.istcp]
                self.setEndpoints(eplist, ieplist)
            else:
                queryFPrx.async_findObjectById4All(self.__queryRegisterCallback,
                                                   self.__object.name())
            self.__lastFreshTime = now
@brief: 刷新服务器列表
@return: 新的服务列表
@rtype: EndPointInfo列表
biliup/Danmaku/tars/__adapterproxy.py