- private static final Logger LOG = Log.getLogger(SocketAddressResolver.class);
-
- private final Executor executor;
- private final Scheduler scheduler;
- private final long timeout;
-
- /**
- * Creates a new instance with the given executor (to perform DNS resolution in a separate thread),
- * the given scheduler (to cancel the operation if it takes too long) and the given timeout, in milliseconds.
- *
- * @param executor the thread pool to use to perform DNS resolution in pooled threads
- * @param scheduler the scheduler to schedule tasks to cancel DNS resolution if it takes too long
- * @param timeout the timeout, in milliseconds, for the DNS resolution to complete
- */
- public SocketAddressResolver(Executor executor, Scheduler scheduler, long timeout)
- {
- this.executor = executor;
- this.scheduler = scheduler;
- this.timeout = timeout;
- }
-
- public Executor getExecutor()
- {
- return executor;
- }
-
- public Scheduler getScheduler()
- {
- return scheduler;
- }
-
- public long getTimeout()
- {
- return timeout;
- }
-