RMIContext rmiContext = pmd.getContext(RMIContext.class);
if (rmiContext != null) {
return rmiContext.getIp();
}
JMXContext jmxContext = pmd.getContext(JMXContext.class);
if (jmxContext != null) {
try {
Field hostField = JMXContext.class.getDeclaredField("host");
hostField.setAccessible(true);
return (String) hostField.get(jmxContext);