1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 18:59:41 +02:00

SMACK-225 Converted abstract class to interface, added missing hashcode method, fixed typos and some minor name changes and added licensing text

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_0@13600 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2013-04-01 13:40:02 +00:00
parent 0a1e72bb5f
commit 9da54ecbce
7 changed files with 81 additions and 23 deletions

View file

@ -28,12 +28,12 @@ import javax.naming.directory.InitialDirContext;
import org.jivesoftware.smack.util.DNSUtil;
/**
* A DNS resolver (mostly for SRV records), which makes use of the API provided in the javax.* namepsace.
* A DNS resolver (mostly for SRV records), which makes use of the API provided in the javax.* namespace.
*
* @author Florian Schmaus
*
*/
public class JavaxResolver extends DNSResolver {
public class JavaxResolver implements DNSResolver {
private static JavaxResolver instance;
private static DirContext dirContext;
@ -48,14 +48,14 @@ public class JavaxResolver extends DNSResolver {
}
// Try to set this DNS resolver as primary one
DNSUtil.setDNSResolver(maybeGetInstance());
DNSUtil.setDNSResolver(getInstance());
}
private JavaxResolver() {
}
public static DNSResolver maybeGetInstance() {
public static DNSResolver getInstance() {
if (instance == null && isSupported()) {
instance = new JavaxResolver();
}