Package org.xbill.DNS.io
Class DefaultIoClientFactory
java.lang.Object
org.xbill.DNS.io.DefaultIoClientFactory
- All Implemented Interfaces:
IoClientFactory
Serves as a default implementation that is used by the
SimpleResolver, unless otherwise
configured. This preserves the default behavior (to use the built-in NIO clients) while allowing
flexibility at the point of use.- Since:
- 3.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate or return a cached/reused instance of the TCP resolver that should be used to send DNS data over the wire to the remote target.Create or return a cached/reused instance of the UDP resolver that should be used to send DNS data over the wire to the remote target.
-
Constructor Details
-
DefaultIoClientFactory
public DefaultIoClientFactory()
-
-
Method Details
-
createOrGetTcpClient
Description copied from interface:IoClientFactoryCreate or return a cached/reused instance of the TCP resolver that should be used to send DNS data over the wire to the remote target.
It is the responsibility of this method to manage pooling or connection reuse. This method is called right before the connection is made every time theSimpleResolveris called. The implementer of this method should be aware and choose how to pool or reuse connections.- Specified by:
createOrGetTcpClientin interfaceIoClientFactory- Returns:
- an instance of the tcp resolver client
-
createOrGetUdpClient
Description copied from interface:IoClientFactoryCreate or return a cached/reused instance of the UDP resolver that should be used to send DNS data over the wire to the remote target.- Specified by:
createOrGetUdpClientin interfaceIoClientFactory- Returns:
- an instance of the udp resolver client
-