1 package org.opendaylight.protocol.framework;
3 import io.netty.util.concurrent.EventExecutor;
4 import io.netty.util.concurrent.Future;
6 import javax.annotation.concurrent.ThreadSafe;
8 import com.google.common.base.Preconditions;
11 * Utility ReconnectStrategy singleton, which will cause the reconnect process
12 * to immediately schedule a reconnection attempt.
15 public final class ReconnectImmediatelyStrategy implements ReconnectStrategy {
16 private final EventExecutor executor;
17 private final int timeout;
19 public ReconnectImmediatelyStrategy(final EventExecutor executor, final int timeout) {
20 Preconditions.checkArgument(timeout >= 0);
21 this.executor = Preconditions.checkNotNull(executor);
22 this.timeout = timeout;
26 public Future<Void> scheduleReconnect() {
27 return executor.newSucceededFuture(null);
31 public void reconnectSuccessful() {
36 public int getConnectTimeout() {