Example usage for io.netty.resolver AddressResolverGroup getResolver

List of usage examples for io.netty.resolver AddressResolverGroup getResolver

Introduction

In this page you can find the example usage for io.netty.resolver AddressResolverGroup getResolver.

Prototype

public AddressResolver<T> getResolver(final EventExecutor executor) 

Source Link

Document

Returns the AddressResolver associated with the specified EventExecutor .

Usage

From source file:org.redisson.connection.DNSMonitor.java

License:Apache License

public DNSMonitor(ConnectionManager connectionManager, RedisClient masterHost, Collection<RedisURI> slaveHosts,
        long dnsMonitoringInterval, AddressResolverGroup<InetSocketAddress> resolverGroup) {
    this.resolver = resolverGroup.getResolver(connectionManager.getGroup().next());

    masterHost.resolveAddr().syncUninterruptibly();
    masters.put(masterHost.getConfig().getAddress(), masterHost.getAddr());

    for (RedisURI host : slaveHosts) {
        Future<InetSocketAddress> resolveFuture = resolver
                .resolve(InetSocketAddress.createUnresolved(host.getHost(), host.getPort()));
        resolveFuture.syncUninterruptibly();
        slaves.put(host, resolveFuture.getNow());
    }/*from   ww  w .  jav  a  2  s .  c  o m*/
    this.connectionManager = connectionManager;
    this.dnsMonitoringInterval = dnsMonitoringInterval;
}