往缓存里放入方法

@param serviceName 服务名（非接口名）
@param method      方法
182347
public static void putOverloadMethodCache(String serviceName, Method method) {
        ConcurrentHashMap<String, Method> cache = OVERLOAD_METHOD_CACHE.get(serviceName);
        if (cache == null) {
            cache = new ConcurrentHashMap<String, Method>();
            ConcurrentHashMap<String, Method> old = OVERLOAD_METHOD_CACHE.putIfAbsent(serviceName, cache);
            if (old != null) {
                cache = old;
            }
        }
        StringBuilder mSigs = new StringBuilder(128);
        mSigs.append(method.getName());
        for (Class<?> paramType : method.getParameterTypes()) {
            mSigs.append(paramType.getName());
        }
        cache.putIfAbsent(mSigs.toString(), method);
    }
72918
private void injectServletCallback(String method) {
        Label tryStart = new Label();
        Label tryEnd = new Label();
        Label catchStart = new Label();
        Label catchEnd = new Label();

        visitTryCatchBlock(tryStart, tryEnd, catchStart, "java/lang/NoClassDefFoundError");
        mark(tryStart); // try {
        loadArgs();
        invokeStatic(Type.getType(SERVLET_CALLBACK_TYPE), Method.getMethod(method));
        mark(tryEnd); // }
        visitJumpInsn(GOTO, catchEnd);
        mark(catchStart); // catch() {
        pop();
        mark(catchEnd); // }
    }
821934
@XmlAttribute(name="name", required=true)
    public void setMethodName(final String methodName) {
        ArgUtils.notEmpty(methodName, methodName);
        this.methodName = methodName;
    }
28834
public static String propertyName(Method method) {
        if (!is(method)) {
            throw new IllegalArgumentException("Method: " + method + " is not a real getter.");
        }
        String name = method.getName();

        if (name.startsWith(GET_PREFIX)) {
            return name.substring(GET_PREFIX.length());
        } else if (name.startsWith(IS_PREFIX)) {
            return name.substring(IS_PREFIX.length());
        } else if (name.startsWith(SHOULD_PREFIX)) {
            name = name.substring(SHOULD_PREFIX.length());
        } else {
            throw new IllegalStateException("Method: " + method + " is a getter but couldn't find a valid prefix.");
        }

        if (name.length() == 1) {
            return name.toUpperCase();
        }
        return name.substring(0, 1).toUpperCase() + name.substring(1);
    }
688804
public void unregisterService(String serviceName, String providerId) {
        getServiceDirectoryClient().unregisterInstance(serviceName, providerId, disableOwnerError);
    }
1131185
public void executeMethod(final HttpMethod method) throws IOException, HttpException {
        if (method == null) {
            throw new IllegalArgumentException("Method may not be null");
        }
        // Link all parameter collections to form the hierarchy:
        // Global -> HttpClient -> HostConfiguration -> HttpMethod
        this.hostConfiguration.getParams().setDefaults(this.params);
        method.getParams().setDefaults(this.hostConfiguration.getParams());
        
        // Generate default request headers
        Collection<?> defaults = (Collection<?>)this.hostConfiguration.getParams().
			getParameter(HostParams.DEFAULT_HEADERS);
        if (defaults != null) {
        	Iterator<?> i = defaults.iterator();
        	while (i.hasNext()) {
        		method.addRequestHeader((Header)i.next());
        	}
        }
        
        try {
            int maxRedirects = this.params.getIntParameter(HttpClientParams.MAX_REDIRECTS, 100);

            for (int redirectCount = 0;;) {

                // make sure the connection we have is appropriate
                if (this.conn != null && !hostConfiguration.hostEquals(this.conn)) {
                    this.conn.setLocked(false);
                    this.conn.releaseConnection();
                    this.conn = null;
                }
        
                // get a connection, if we need one
                if (this.conn == null) {
                    this.conn = connectionManager.getConnectionWithTimeout(
                        hostConfiguration,
                        this.params.getConnectionManagerTimeout() 
                    );
                    this.conn.setLocked(true);
                    if (this.params.isAuthenticationPreemptive()
                     || this.state.isAuthenticationPreemptive()) 
                    {
                        LOG.debug("Preemptively sending default basic credentials");
                        method.getHostAuthState().setPreemptive();
                        method.getHostAuthState().setAuthAttempted(true);
                        if (this.conn.isProxied() && !this.conn.isSecure()) {
                            method.getProxyAuthState().setPreemptive();
                            method.getProxyAuthState().setAuthAttempted(true);
                        }
                    }
                }
                authenticate(method);
                executeWithRetry(method);
                if (this.connectMethod != null) {
                    fakeResponse(method);
                    break;
                }
                
                boolean retry = false;
                if (isRedirectNeeded(method)) {
                    if (processRedirectResponse(method)) {
                        retry = true;
                        ++redirectCount;
                        if (redirectCount >= maxRedirects) {
                            LOG.error("Narrowly avoided an infinite loop in execute");
                            throw new RedirectException("Maximum redirects ("
                                + maxRedirects + ") exceeded");
                        }
                        if (LOG.isDebugEnabled()) {
                            LOG.debug("Execute redirect " + redirectCount + " of " + maxRedirects);
                        }
                    }
                }
                if (isAuthenticationNeeded(method)) {
                    if (processAuthenticationResponse(method)) {
                        LOG.debug("Retry authentication");
                        retry = true;
                    }
                }
                if (!retry) {
                    break;
                }
                // retry - close previous stream.  Caution - this causes
                // responseBodyConsumed to be called, which may also close the
                // connection.
                if (method.getResponseBodyAsStream() != null) {
                    method.getResponseBodyAsStream().close();
                }

            } //end of retry loop
        } finally {
            if (this.conn != null) {
                this.conn.setLocked(false);
            }
            // If the response has been fully processed, return the connection
            // to the pool.  Use this flag, rather than other tests (like
            // responseStream == null), as subclasses, might reset the stream,
            // for example, reading the entire response into a file and then
            // setting the file as the stream.
            if (
                (releaseConnection || method.getResponseBodyAsStream() == null) 
                && this.conn != null
            ) {
                this.conn.releaseConnection();
            }
        }

    }
198136
public function setServiceMethod(string $method): void
    {
        $this->service && $this->service->setMethod($method);
    }
244383
@Override
    public void setMethod(MethodValues method) {
        this.myMethod = method;
        super.setFirstLineChanged();
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "setMethod(v): " + (null != method ? method.getName() : null));
        }
    }
561072
public static void validateMethodOrThrow(Method method) {
    Class<?> returnType = method.getReturnType();
    if (returnType.equals(Void.TYPE)) {
      return;
    } else if (!Publisher.class.isAssignableFrom(returnType)) {
      throw new UnsupportedOperationException("Service method return type can be Publisher only");
    }
    if (method.getParameterCount() > 1) {
      throw new UnsupportedOperationException("Service method can accept 0 or 1 parameters only");
    }
  }
1016216
public static String getMethodName(ServiceMethod serviceMethod) {
        String name = serviceMethod.getName();
        String formattedName = Formatter.toCamelCase(name);
        if (isReservedKeyword(formattedName)) {
            return formattedName + '_';
        }
        return formattedName;
    }
1304785
public ServiceMethod createAndGatherImports (Method method, ImportSet imports)
    {
        ServiceMethod sm = new ServiceMethod(method);
        sm.gatherImports(imports);
        return sm;
    }
668546
private static String[] getHttpMethodAndPath(Method method) {
		if(null == method){
			return null;
		}
		
		String[] httpMethodAndPath;
		Route routeAnnotation = method.getAnnotation(Route.class);
		if(null != routeAnnotation){//从Annotation中获取HttpMethod和路径
			httpMethodAndPath = getHttpMethodAndPath(routeAnnotation);
			if(null != httpMethodAndPath[0] && StrUtil.isBlank(httpMethodAndPath[1])){
				//对于"post:"这类Route，依旧使用方法名做为路径一部分
				httpMethodAndPath[1] = method.getName();
			}
		}else{
			httpMethodAndPath = new String[]{null, method.getName()};
		}
		return httpMethodAndPath;
	}
376033
public <T> T getService(String serviceName) {
    T service = findService(serviceName, true);
    if (service == null) {
      throw new IllegalArgumentException(format("No service found named \"%s\"", serviceName));
    }

    return service;
  }
841652
@Override
	public boolean permit(String resourceId, Class c, Object target, String method) {
		if (c.isArray()) {
			// 允许调用，但实际上会在在其后调用中报错。不归此处管理
			return true;
		}
		String name = c.getName();
		String className = null;
		String pkgName = null;
		int i = name.lastIndexOf('.');
		if (i != -1) {
			pkgName = name.substring(0, i);
			className = name.substring(i + 1);

		} else {
			// 无包名，允许调用
			return true;
		}

		if (pkgName.startsWith("java.lang")) {
			if (className.equals("Runtime") || className.equals("Process") || className.equals("ProcessBuilder")
					|| className.equals("System")) {
				return false;
			}
		}

		return true;
	}
271444
@ObjectiveCName("rawRequestWithService:withMethod:WithParams:")
    public void rawRequest(String service, String method, ApiRawValue params) {
        modules.getExternalModule().rawRequest(service, method, params);
    }
224512
private static void removeMethodByName(Method method, List<Method> methods) {
    if(methods != null) {
      Iterator<Method> itr = methods.iterator();
      Method aMethod = null;
      while(itr.hasNext()) {
        aMethod = itr.next();
        if(aMethod.getName().equals(method.getName())) {
          itr.remove();
          break;
        }
      }
      if(aMethod != null) {
        methods.add(aMethod);
      }
    }
  }
581665
public void deleteService(String serviceId) {

        DeleteServiceRequest deleteServiceRequest = new DeleteServiceRequest().withId(serviceId);
        getDiscoveryClient().deleteService(deleteServiceRequest);

    }