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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DefaultIoClientShared instance because it only serves as a bridge to the static NIO classes and does not need to be different per class. -
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.
-
Field Details
-
RESOLVER_CLIENT
Shared instance because it only serves as a bridge to the static NIO classes and does not need to be different per class.
-
-
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
-