X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fcommons%2Fprotocol-framework%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fframework%2FAbstractDispatcher.java;h=80e30dc90c61e914dcc32a089197eff16f2886ee;hp=17663d982c5e188f7c898f9575571fb478e61bc5;hb=6ca44d2095f0887508dd32f0174058a627eff4f9;hpb=2727bea09c83646b6cbd2ef9672d0b7f6cf3b22f diff --git a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java index 17663d982c..80e30dc90c 100644 --- a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java +++ b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java @@ -7,15 +7,7 @@ */ package org.opendaylight.protocol.framework; -import java.io.Closeable; -import java.net.InetSocketAddress; -import java.net.SocketAddress; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import com.google.common.base.Preconditions; - import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; import io.netty.buffer.PooledByteBufAllocator; @@ -34,6 +26,11 @@ import io.netty.util.concurrent.EventExecutor; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GlobalEventExecutor; import io.netty.util.concurrent.Promise; +import java.io.Closeable; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Dispatcher class for creating servers and clients. The idea is to first create servers and clients and the run the @@ -106,7 +103,7 @@ public abstract class AbstractDispatcher, L extends @Override protected void initChannel(final CH ch) { - initializer.initializeChannel(ch, new DefaultPromise(executor)); + initializer.initializeChannel(ch, new DefaultPromise<>(executor)); } }); @@ -124,7 +121,7 @@ public abstract class AbstractDispatcher, L extends } try { b.channel(channelClass); - } catch (IllegalStateException e) { + } catch (final IllegalStateException e) { // FIXME: if this is ok, document why LOG.trace("Not overriding channelFactory on bootstrap {}", b, e); } @@ -150,7 +147,7 @@ public abstract class AbstractDispatcher, L extends * Creates a client. * * @param address remote address - * @param connectStrategy Reconnection strategy to be used when initial connection fails + * @param strategy Reconnection strategy to be used when initial connection fails * * @return Future representing the connection process. Its result represents the combined success of TCP connection * as well as session negotiation. @@ -269,15 +266,10 @@ public abstract class AbstractDispatcher, L extends } /** - * @deprecated Should only be used with {@link AbstractDispatcher#AbstractDispatcher()} + * @deprecated Should only be used with AbstractDispatcher#AbstractDispatcher() */ @Deprecated @Override public void close() { - try { - this.workerGroup.shutdownGracefully(); - } finally { - this.bossGroup.shutdownGracefully(); - } } }