2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.protocol.framework;
10 import io.netty.util.concurrent.EventExecutor;
11 import io.netty.util.concurrent.Future;
13 import javax.annotation.concurrent.ThreadSafe;
15 import com.google.common.base.Preconditions;
18 * Utility ReconnectStrategy singleton, which will cause the reconnect process
22 public final class NeverReconnectStrategy implements ReconnectStrategy {
23 private final EventExecutor executor;
24 private final int timeout;
26 public NeverReconnectStrategy(final EventExecutor executor, final int timeout) {
27 Preconditions.checkArgument(timeout >= 0);
28 this.executor = Preconditions.checkNotNull(executor);
29 this.timeout = timeout;
33 public Future<Void> scheduleReconnect(final Throwable cause) {
34 return executor.newFailedFuture(new Throwable());
38 public void reconnectSuccessful() {
43 public int getConnectTimeout() {