| 1 |
|
package javax.jmdns; |
| 2 |
|
|
| 3 |
|
import java.net.InetAddress; |
| 4 |
|
import java.net.NetworkInterface; |
| 5 |
|
import java.util.concurrent.atomic.AtomicReference; |
| 6 |
|
|
| 7 |
|
import javax.jmdns.impl.NetworkTopologyDiscoveryImpl; |
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
|
| 44 |
|
|
| 45 |
|
|
| 46 |
|
|
| 47 |
|
|
| 48 |
|
|
| 49 |
|
@author |
| 50 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 51 |
|
public interface NetworkTopologyDiscovery { |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
|
| 55 |
|
|
|
|
|
| 0% |
Uncovered Elements: 26 (26) |
Complexity: 9 |
Complexity Density: 0.69 |
|
| 56 |
|
public static final class Factory { |
| 57 |
|
private static volatile NetworkTopologyDiscovery _instance; |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
|
| 61 |
|
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
| 62 |
|
public static interface ClassDelegate { |
| 63 |
|
|
| 64 |
|
|
| 65 |
|
|
| 66 |
|
|
| 67 |
|
@return |
| 68 |
|
@see |
| 69 |
|
@see |
| 70 |
|
|
| 71 |
|
public NetworkTopologyDiscovery newNetworkTopologyDiscovery(); |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
private static final AtomicReference<Factory.ClassDelegate> _databaseClassDelegate = new AtomicReference<Factory.ClassDelegate>(); |
| 75 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 76 |
0
|
private Factory() {... |
| 77 |
0
|
super(); |
| 78 |
|
} |
| 79 |
|
|
| 80 |
|
|
| 81 |
|
|
| 82 |
|
|
| 83 |
|
@param |
| 84 |
|
|
| 85 |
|
@see |
| 86 |
|
@see |
| 87 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 88 |
0
|
public static void setClassDelegate(Factory.ClassDelegate delegate) {... |
| 89 |
0
|
_databaseClassDelegate.set(delegate); |
| 90 |
|
} |
| 91 |
|
|
| 92 |
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
|
@return |
| 96 |
|
@see |
| 97 |
|
@see |
| 98 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 99 |
0
|
public static Factory.ClassDelegate classDelegate() {... |
| 100 |
0
|
return _databaseClassDelegate.get(); |
| 101 |
|
} |
| 102 |
|
|
| 103 |
|
|
| 104 |
|
|
| 105 |
|
|
| 106 |
|
@return |
| 107 |
|
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 108 |
0
|
protected static NetworkTopologyDiscovery newNetworkTopologyDiscovery() {... |
| 109 |
0
|
NetworkTopologyDiscovery instance = null; |
| 110 |
0
|
Factory.ClassDelegate delegate = _databaseClassDelegate.get(); |
| 111 |
0
|
if (delegate != null) { |
| 112 |
0
|
instance = delegate.newNetworkTopologyDiscovery(); |
| 113 |
|
} |
| 114 |
0
|
return (instance != null ? instance : new NetworkTopologyDiscoveryImpl()); |
| 115 |
|
} |
| 116 |
|
|
| 117 |
|
|
| 118 |
|
|
| 119 |
|
|
| 120 |
|
@return |
| 121 |
|
|
|
|
|
| 0% |
Uncovered Elements: 9 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 122 |
0
|
public static NetworkTopologyDiscovery getInstance() {... |
| 123 |
0
|
if (_instance == null) { |
| 124 |
0
|
synchronized (NetworkTopologyDiscovery.Factory.class) { |
| 125 |
0
|
if (_instance == null) { |
| 126 |
0
|
_instance = NetworkTopologyDiscovery.Factory.newNetworkTopologyDiscovery(); |
| 127 |
|
} |
| 128 |
|
} |
| 129 |
|
} |
| 130 |
0
|
return _instance; |
| 131 |
|
} |
| 132 |
|
} |
| 133 |
|
|
| 134 |
|
|
| 135 |
|
|
| 136 |
|
|
| 137 |
|
@return |
| 138 |
|
|
| 139 |
|
public abstract InetAddress[] getInetAddresses(); |
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
@param |
| 145 |
|
@param |
| 146 |
|
@return |
| 147 |
|
|
| 148 |
|
public boolean useInetAddress(NetworkInterface networkInterface, InetAddress interfaceAddress); |
| 149 |
|
|
| 150 |
|
|
| 151 |
|
|
| 152 |
|
|
| 153 |
|
@param |
| 154 |
|
|
| 155 |
|
public void lockInetAddress(InetAddress interfaceAddress); |
| 156 |
|
|
| 157 |
|
|
| 158 |
|
|
| 159 |
|
|
| 160 |
|
@param |
| 161 |
|
|
| 162 |
|
public void unlockInetAddress(InetAddress interfaceAddress); |
| 163 |
|
|
| 164 |
|
} |