XMemcachedConstructorWithInetSocketAddressArgInterceptor implements InstanceConstructorInterceptor { @Override public void onConstruct(EnhancedInstance objInst, Object[] allArguments) { InetSocketAddress inetSocketAddress = (InetSocketAddress) allArguments[0]; String host = inetSocketAddress.getAddress().getHostAddress(); int port = inetSocketAddress.getPort(); objInst.setSkyWalkingDynamicField(host + ":" + port); }  @Override void onConstruct(EnhancedInstance objInst, Object[] allArguments);  }
@Test public void onConstructWithInetSocketAddress() { interceptor.onConstruct(enhancedInstance, new Object[] {new InetSocketAddress("127.0.0.1", 11211)}); verify(enhancedInstance).setSkyWalkingDynamicField("127.0.0.1:11211"); }