docs: public static String getLocalConnectorAddress(String pid) throws IOException {// NOSONAR
  		VirtualMachine vm = null;
  		// 1. attach vm
  		try {
  			vm = VirtualMachine.attach(pid);
  		} catch (AttachNotSupportedException x) {
  			IOException ioe = new IOException(x.getMessage());
  			ioe.initCause(x);
  			throw ioe;
  		}
  
  		try {
  			// 2. 检查smartAgent是否已启动
  			Properties agentProps = vm.getAgentProperties();
  			String address = (String) agentProps.get(LOCAL_CONNECTOR_ADDRESS_PROP);
  
  			if (address != null) {
  				return address;
  			}
  
  			// 3. 未启动，尝试启动
  			// JDK8后有更直接的vm.startLocalManagementAgent()方法
  			String home = vm.getSystemProperties().getProperty("java.home");
  
  			// Normally in ${java.home}/jre/lib/management-agent.jar but might
  			// be in ${java.home}/lib in build environments.
  
  			String agentPath = home + File.separator + "jre" + File.separator + "lib" + File.separator
  					+ "management-agent.jar";
  			File f = new File(agentPath);
  			if (!f.exists()) {
  				agentPath = home + File.separator + "lib" + File.separator + "management-agent.jar";
  				f = new File(agentPath);
  				if (!f.exists()) {
  					throw new IOException("Management agent not found");
  				}
  			}
  
  			agentPath = f.getCanonicalPath();
  			try {
  				vm.loadAgent(agentPath, "com.sun.management.jmxremote");
  			} catch (AgentLoadException x) {
  				IOException ioe = new IOException(x.getMessage());
  				ioe.initCause(x);
  				throw ioe;
  			} catch (AgentInitializationException x) {
  				IOException ioe = new IOException(x.getMessage());
  				ioe.initCause(x);
  				throw ioe;
  			}
  
  			// 4. 再次获取connector address
  			agentProps = vm.getAgentProperties();
  			address = (String) agentProps.get(LOCAL_CONNECTOR_ADDRESS_PROP);
  
  			if (address == null) {
  				throw new IOException("Fails to find connector address");
  			}
  
  			return address;
  		} finally {
  			vm.detach();
  		}
  	}