反注册服务信息

@param serviceName  服务关键字
@param providerInfo 服务提供者数据
162176
protected void doUnRegister(String serviceName, ProviderInfo providerInfo) {
        //{service : [provider...]}
        ProviderGroup oldGroup = memoryCache.get(serviceName);
        if (oldGroup != null) { // 存在老的key
            oldGroup.remove(providerInfo);
        } else {
            return;
        }
        // 备份到文件 改为定时写
        needBackup = true;
        doWriteFile();

        if (subscribe) {
            notifyConsumerListeners(serviceName, memoryCache.get(serviceName));
        }
    }
1188563
public void unregisterService(String serviceName, String providerId) {
        getServiceDirectoryClient().unregisterServiceInstance(serviceName, providerId);
        getCacheServiceInstances().remove(new ServiceInstanceToken(serviceName, providerId));
    }
6549
static Node getNodeInfo(String serviceName) {
    String jvmName = ManagementFactory.getRuntimeMXBean().getName();
    Timestamp censusTimestamp = Timestamp.fromMillis(System.currentTimeMillis());
    return Node.newBuilder()
        .setIdentifier(getProcessIdentifier(jvmName, censusTimestamp))
        .setLibraryInfo(getLibraryInfo(OpenCensusLibraryInformation.VERSION))
        .setServiceInfo(getServiceInfo(serviceName))
        .build();
  }
1032536
protected void checkProviderInfo(ProviderGroup providerGroup) {
        List<ProviderInfo> providerInfos = providerGroup == null ? null : providerGroup.getProviderInfos();
        if (CommonUtils.isEmpty(providerInfos)) {
            return;
        }
        Iterator<ProviderInfo> iterator = providerInfos.iterator();
        while (iterator.hasNext()) {
            ProviderInfo providerInfo = iterator.next();
            if (!StringUtils.equals(providerInfo.getProtocolType(), consumerConfig.getProtocol())) {
                if (LOGGER.isWarnEnabled(consumerConfig.getAppName())) {
                    LOGGER.warnWithApp(consumerConfig.getAppName(),
                        "Unmatched protocol between consumer [{}] and provider [{}].",
                        consumerConfig.getProtocol(), providerInfo.getProtocolType());
                }
            }
        }
    }
458399
public ProviderGroup add(ProviderInfo providerInfo) {
        if (providerInfo == null) {
            return this;
        }
        ConcurrentHashSet<ProviderInfo> tmp = new ConcurrentHashSet<ProviderInfo>(providerInfos);
        tmp.add(providerInfo); // 排重
        this.providerInfos = new ArrayList<ProviderInfo>(tmp);
        return this;
    }
42984
public void serviceName_cdn_serviceInfosUpdate_POST(String serviceName, OvhRenewType renew) throws IOException {
		String qPath = "/hosting/web/{serviceName}/cdn/serviceInfosUpdate";
		StringBuilder sb = path(qPath, serviceName);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "renew", renew);
		exec(qPath, "POST", sb.toString(), o);
	}
222896
public List<String> getServiceImplementations(String serviceTypeName) {
        final List<String> strings = services.get(serviceTypeName);
        return strings == null ? Collections.<String>emptyList() : Collections.unmodifiableList(strings);
    }
772455
@Override
    public <T> PluggableProviderService<T> createPluginService(Class<T> type, final String serviceName) {
        //load provider service implementation via java ServiceLoader if available
        PluggableProviderService<T> pluginProviderService = ServiceTypes.getPluginProviderService(type, serviceName, this);
        if (null != pluginProviderService) {
            return pluginProviderService;
        }

        //otherwise construct default service implementation
        BasePluginProviderService<T> basePluginProviderService = new BasePluginProviderService<T>(
                serviceName,
                type
        );
        basePluginProviderService.setRundeckServerServiceProviderLoader(this);
        return basePluginProviderService;
    }
355309
@FFDCIgnore(Exception.class)
    private void logProviderInfo(String providerName, ClassLoader loader) {
        try {
            if (PROVIDER_ECLIPSELINK.equals(providerName)) {
                // org.eclipse.persistence.Version.getVersion(): 2.6.4.v20160829-44060b6
                Class<?> Version = loadClass(loader, "org.eclipse.persistence.Version");
                String version = (String) Version.getMethod("getVersionString").invoke(Version.newInstance());
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "EclipseLink", version);
            } else if (PROVIDER_HIBERNATE.equals(providerName)) {
                // org.hibernate.Version.getVersionString(): 5.2.6.Final
                Class<?> Version = loadClass(loader, "org.hibernate.Version");
                String version = (String) Version.getMethod("getVersionString").invoke(null);
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "Hibernate", version);
            } else if (PROVIDER_OPENJPA.equals(providerName)) {
                // OpenJPAVersion.appendOpenJPABanner(sb): OpenJPA #.#.#\n version id: openjpa-#.#.#-r# \n Apache svn revision: #
                StringBuilder version = new StringBuilder();
                Class<?> OpenJPAVersion = loadClass(loader, "org.apache.openjpa.conf.OpenJPAVersion");
                OpenJPAVersion.getMethod("appendOpenJPABanner", StringBuilder.class).invoke(OpenJPAVersion.newInstance(), version);
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I", "OpenJPA", version);
            } else {
                Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);
            }
        } catch (Exception x) {
            Tr.info(tc, "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I", providerName);
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(this, tc, "unable to determine provider info", x);
        }
    }
1213964
private void checkCallService( RequestCallInfo info )
	{
		String service = info.request.service;
		String interfaceChecksum = info.request.interfaceChecksum;

		String key = getServiceKey( info );

		if( usedServices.containsKey( key ) )
			return;

		ServiceInfo serviceInfo = new ServiceInfo( service, interfaceChecksum );
		serviceInfo.id = usedServices.size();
		usedServices.put( key, serviceInfo );
	}
609058
public void zone_zoneName_serviceInfos_PUT(String zoneName, OvhService body) throws IOException {
		String qPath = "/domain/zone/{zoneName}/serviceInfos";
		StringBuilder sb = path(qPath, zoneName);
		exec(qPath, "PUT", sb.toString(), body);
	}
688680
private static WebServiceRefPartialInfo buildPartialInfoFromWebServiceClient(Class<?> serviceInterfaceClass) {

        WebServiceClient webServiceClient = serviceInterfaceClass.getAnnotation(WebServiceClient.class);
        if (webServiceClient == null) {
            return null;
        }
        String className = serviceInterfaceClass.getName();
        String wsdlLocation = webServiceClient.wsdlLocation();
        QName serviceQName = null;
        String localPart = webServiceClient.name();
        if (localPart != null) {
            serviceQName = new QName(webServiceClient.targetNamespace(), localPart);
        }

        String handlerChainDeclaringClassName = null;
        javax.jws.HandlerChain handlerChainAnnotation = serviceInterfaceClass.getAnnotation(javax.jws.HandlerChain.class);
        if (handlerChainAnnotation != null)
            handlerChainDeclaringClassName = serviceInterfaceClass.getName();
        WebServiceRefPartialInfo partialInfo = new WebServiceRefPartialInfo(className, wsdlLocation, serviceQName, null, handlerChainDeclaringClassName, handlerChainAnnotation);
        return partialInfo;
    }
1334972
private void unregisterCachedServiceInstance(
            String serviceName, String providerId) {
        try {
            write.lock();
            ServiceInstanceId id = new ServiceInstanceId(serviceName, providerId);
            getCacheServiceInstances().remove(id);
            LOGGER.debug(
                    "delete cached ProvidedServiceInstance, serviceName={}, providerId={}.",
                    serviceName, providerId);
        } finally {
            write.unlock();
        }
    }
746842
public void packName_serviceInfos_PUT(String packName, OvhService body) throws IOException {
		String qPath = "/pack/xdsl/{packName}/serviceInfos";
		StringBuilder sb = path(qPath, packName);
		exec(qPath, "PUT", sb.toString(), body);
	}
536150
protected ProviderInfo select(SofaRequest message, List<ProviderInfo> invokedProviderInfos)
        throws SofaRpcException {
        // 粘滞连接，当前连接可用
        if (consumerConfig.isSticky()) {
            if (lastProviderInfo != null) {
                ProviderInfo providerInfo = lastProviderInfo;
                ClientTransport lastTransport = connectionHolder.getAvailableClientTransport(providerInfo);
                if (lastTransport != null && lastTransport.isAvailable()) {
                    checkAlias(providerInfo, message);
                    return providerInfo;
                }
            }
        }
        // 原始服务列表数据 --> 路由结果
        List<ProviderInfo> providerInfos = routerChain.route(message, null);

        //保存一下原始地址,为了打印
        List<ProviderInfo> orginalProviderInfos = new ArrayList<ProviderInfo>(providerInfos);

        if (CommonUtils.isEmpty(providerInfos)) {
            throw noAvailableProviderException(message.getTargetServiceUniqueName());
        }
        if (CommonUtils.isNotEmpty(invokedProviderInfos) && providerInfos.size() > invokedProviderInfos.size()) { // 总数大于已调用数
            providerInfos.removeAll(invokedProviderInfos);// 已经调用异常的本次不再重试
        }

        String targetIP = null;
        ProviderInfo providerInfo;
        RpcInternalContext context = RpcInternalContext.peekContext();
        if (context != null) {
            targetIP = (String) RpcInternalContext.getContext().getAttachment(RpcConstants.HIDDEN_KEY_PINPOINT);
        }
        if (StringUtils.isNotBlank(targetIP)) {
            // 如果指定了调用地址
            providerInfo = selectPinpointProvider(targetIP, providerInfos);
            if (providerInfo == null) {
                // 指定的不存在
                throw unavailableProviderException(message.getTargetServiceUniqueName(), targetIP);
            }
            ClientTransport clientTransport = selectByProvider(message, providerInfo);
            if (clientTransport == null) {
                // 指定的不存在或已死，抛出异常
                throw unavailableProviderException(message.getTargetServiceUniqueName(), targetIP);
            }
            return providerInfo;
        } else {
            do {
                // 再进行负载均衡筛选
                providerInfo = loadBalancer.select(message, providerInfos);
                ClientTransport transport = selectByProvider(message, providerInfo);
                if (transport != null) {
                    return providerInfo;
                }
                providerInfos.remove(providerInfo);
            } while (!providerInfos.isEmpty());
        }
        throw unavailableProviderException(message.getTargetServiceUniqueName(),
            convertProviders2Urls(orginalProviderInfos));
    }
811030
public ArrayList<Long> serviceName_monitoringNotifications_GET(String serviceName) throws IOException {
		String qPath = "/xdsl/{serviceName}/monitoringNotifications";
		StringBuilder sb = path(qPath, serviceName);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t15);
	}
916981
function getServiceInfo(serviceName, adapterMap) {
        var serviceInfo = { serviceName: serviceName };
        var serviceParts = utils.splitCamelCase(serviceName);  // turn oneTwoThree into ['one', 'two', 'three']
        var nbrParts = serviceParts.length;

        // first check to see if the second to last part is an adapter
        serviceInfo.adapterName = serviceParts[nbrParts - 2];  // NOTE: last item in array is 'Service'
        if (adapterMap[serviceInfo.adapterName]) {
            serviceInfo.resourceName = serviceParts.slice(0, nbrParts - 2).join('.');
        }
        // if not, it means we are dealing with a straight service (ex. postService)
        else {
            serviceInfo.adapterName = 'service';
            serviceInfo.resourceName = serviceParts.slice(0, nbrParts - 1).join('.');
        }

        serviceInfo.adapterImpl = adapterMap[serviceInfo.adapterName];

        return serviceInfo;
    }