JolokiaHttpHandler implements HttpHandler { private String getHostName(InetSocketAddress address) { return configuration.getAsBoolean(ConfigKey.ALLOW_DNS_REVERSE_LOOKUP) ? address.getHostName() : null; } JolokiaHttpHandler(Configuration pConfig);  JolokiaHttpHandler(Configuration pConfig, LogHandler pLogHandler); void start(boolean pLazy); void start(boolean pLazy, String pUrl, boolean pSecured); void stop(); void handle(final HttpExchange pHttpExchange); @SuppressWarnings({"PMD.AvoidCatchingThrowable", "PMD.AvoidInstanceofChecksInCatchClause"}) void doHandle(HttpExchange pExchange);  }
@Test public void restrictorWithReverseDnsLookup() throws URISyntaxException, IOException, ParseException { Configuration config = getConfig( ConfigKey.RESTRICTOR_CLASS, TestReverseDnsLookupRestrictor.class.getName(), ConfigKey.ALLOW_DNS_REVERSE_LOOKUP, "true"); InetSocketAddress address = new InetSocketAddress(8080); TestReverseDnsLookupRestrictor.expectedRemoteHostsToCheck = new String[] { address.getHostName(), address.getAddress().getHostAddress() }; JSONObject resp = simpleMemoryGetReadRequest(config); assertFalse(resp.containsKey("error")); }