Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
protocol-framework: final parameters
[controller.git]
/
opendaylight
/
commons
/
protocol-framework
/
src
/
main
/
java
/
org
/
opendaylight
/
protocol
/
framework
/
AbstractDispatcher.java
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 7f5233c827c2624befc01adb1b9c02a5da30c606..80e30dc90c61e914dcc32a089197eff16f2886ee 100644
(file)
--- 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;
*/
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 com.google.common.base.Preconditions;
-
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.PooledByteBufAllocator;
@@
-34,11
+26,17
@@
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 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
* start method that will handle sockets in different thread.
*/
/**
* Dispatcher class for creating servers and clients. The idea is to first create servers and clients and the run the
* start method that will handle sockets in different thread.
*/
+@Deprecated
public abstract class AbstractDispatcher<S extends ProtocolSession<?>, L extends SessionListener<?, ?, ?>> implements Closeable {
public abstract class AbstractDispatcher<S extends ProtocolSession<?>, L extends SessionListener<?, ?, ?>> implements Closeable {
@@
-105,7
+103,7
@@
public abstract class AbstractDispatcher<S extends ProtocolSession<?>, L extends
@Override
protected void initChannel(final CH ch) {
@Override
protected void initChannel(final CH ch) {
- initializer.initializeChannel(ch, new DefaultPromise<
S
>(executor));
+ initializer.initializeChannel(ch, new DefaultPromise<>(executor));
}
});
}
});
@@
-113,6
+111,7
@@
public abstract class AbstractDispatcher<S extends ProtocolSession<?>, L extends
if (LocalServerChannel.class.equals(channelClass) == false) {
// makes no sense for LocalServer and produces warning
b.childOption(ChannelOption.SO_KEEPALIVE, true);
if (LocalServerChannel.class.equals(channelClass) == false) {
// makes no sense for LocalServer and produces warning
b.childOption(ChannelOption.SO_KEEPALIVE, true);
+ b.childOption(ChannelOption.TCP_NODELAY , true);
}
b.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
customizeBootstrap(b);
}
b.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
customizeBootstrap(b);
@@
-122,7
+121,7
@@
public abstract class AbstractDispatcher<S extends ProtocolSession<?>, L extends
}
try {
b.channel(channelClass);
}
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);
}
// FIXME: if this is ok, document why
LOG.trace("Not overriding channelFactory on bootstrap {}", b, e);
}
@@
-148,7
+147,7
@@
public abstract class AbstractDispatcher<S extends ProtocolSession<?>, L extends
* Creates a client.
*
* @param address remote address
* Creates a client.
*
* @param address remote address
- * @param
connectS
trategy Reconnection strategy to be used when initial connection fails
+ * @param
s
trategy 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.
*
* @return Future representing the connection process. Its result represents the combined success of TCP connection
* as well as session negotiation.
@@
-267,15
+266,10
@@
public abstract class AbstractDispatcher<S extends ProtocolSession<?>, L extends
}
/**
}
/**
- * @deprecated Should only be used with
{@link AbstractDispatcher#AbstractDispatcher()}
+ * @deprecated Should only be used with
AbstractDispatcher#AbstractDispatcher()
*/
@Deprecated
@Override
public void close() {
*/
@Deprecated
@Override
public void close() {
- try {
- this.workerGroup.shutdownGracefully();
- } finally {
- this.bossGroup.shutdownGracefully();
- }
}
}
}
}