怎样获得jmx调用客户端的IP,how to get client ip of jmx

JMX基于RMI,获得客户端ip的方法是和RMI的方法一样的:

 

public String getClientIp()
	{
		try
		{
			String clienthost = RemoteServer.getClientHost();
			InetAddress ia = java.net.InetAddress.getByName(clienthost);
			return ia.getHostAddress();
		}
		catch (Exception e)
		{
			Log.error(e);
			return "Unknow Client";
		}
	}

Total views.

© 2013 - 2018. All rights reserved.

Powered by Hydejack v6.6.1