File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Java Dns Cache Manipulator(DCM)
44[ ![ Build Status] ( https://travis-ci.org/alibaba/java-dns-cache-manipulator.svg?branch=master )] ( https://travis-ci.org/alibaba/java-dns-cache-manipulator ) [ ![ Coverage Status] ( https://coveralls.io/repos/alibaba/java-dns-cache-manipulator/badge.svg?branch=master )] ( https://coveralls.io/r/alibaba/java-dns-cache-manipulator?branch=master )
55[ ![ GitHub issues] ( https://img.shields.io/github/issues/alibaba/java-dns-cache-manipulator.svg )] ( https://github.com/alibaba/java-dns-cache-manipulator/issues ) [ ![ Maven Central] ( https://maven-badges.herokuapp.com/maven-central/com.alibaba/dns-cache-manipulator/badge.svg )] ( https://maven-badges.herokuapp.com/maven-central/com.alibaba/dns-cache-manipulator/ ) [ ![ License] ( https://img.shields.io/badge/license-Apache%202-blue.svg )] ( https://www.apache.org/licenses/LICENSE-2.0.html )
66
7- :point_right : 通过代码直接设置` Java ` 的` DNS ` (实际上设置的是` DNS Cache ` ),支持` JDK 7 + ` 。
7+ :point_right : 通过代码直接设置` Java ` 的` DNS ` (实际上设置的是` DNS Cache ` ),支持` JDK 6 + ` 。
88
99:wrench : 功能
1010----------------------------
@@ -110,7 +110,7 @@ public void beforeClass() throws Exception {
110110
111111通过查看类` InetAddress ` 的实现可以确定:通过以` addressCache ` 字段为锁的` synchronized ` 块来保证线程安全。
112112
113- 关键代码如下 :
113+ 其中关键代码( ` JDK 7 ` )如下 :
114114
115115``` java
116116/*
@@ -138,3 +138,7 @@ private static void cacheAddresses(String hostname,
138138- [ tanhaichao] ( https://github.com/tanhaichao ) 的[ ` javahost ` 项目] ( https://github.com/tanhaichao/javahost ) ,
139139 该项目的[ 使用文档] ( http://leopard.io/modules/javahost ) 。
140140 本项目如何设置` Java DNS Cache ` 的解法来自该项目。刚开始在持续集成项目中碰到` host ` 绑定的问题时,也是使用该项目来解决的 :+1 :
141+ - 类` InetAddress ` 的源代码:
142+ - ` JDK 6 ` 的[ ` InetAddress ` ] ( http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b27/java/net/InetAddress.java#InetAddress.CacheEntry )
143+ - ` JDK 7 ` 的[ ` InetAddress ` ] ( http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/net/InetAddress.java#InetAddress.CacheEntry )
144+ - ` JDK 8 ` 的[ ` InetAddress ` ] ( http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/net/InetAddress.java#InetAddress.CacheEntry )
You can’t perform that action at this time.
0 commit comments