From b9039eaa82e5651a4eeb444954cacbe64fff8b73 Mon Sep 17 00:00:00 2001
From: Trustin Lee
* Note: send/receive must use {@link UdtMessage} in the pipeline
*/
-public class NioUdtMessageRendezvousChannel extends
- NioUdtMessageConnectorChannel {
+public class NioUdtMessageRendezvousChannel extends NioUdtMessageConnectorChannel {
public NioUdtMessageRendezvousChannel() {
super(NioUdtProvider.newRendezvousChannelUDT(TypeUDT.DATAGRAM));
}
-
}
diff --git a/transport-udt/src/main/java/io/netty/channel/udt/nio/NioUdtProvider.java b/transport-udt/src/main/java/io/netty/channel/udt/nio/NioUdtProvider.java
index c2c8d00172..22eca7555c 100644
--- a/transport-udt/src/main/java/io/netty/channel/udt/nio/NioUdtProvider.java
+++ b/transport-udt/src/main/java/io/netty/channel/udt/nio/NioUdtProvider.java
@@ -201,35 +201,35 @@ public final class NioUdtProvider
* This will result in having the
* {@link ChannelOutboundHandler#bind(ChannelHandlerContext, SocketAddress, ChannelPromise)} method
- * called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelFuture bind(SocketAddress localAddress);
@@ -255,7 +255,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelFuture connect(SocketAddress remoteAddress);
@@ -267,7 +267,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress);
@@ -278,7 +278,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#disconnect(ChannelHandlerContext, ChannelPromise)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelFuture disconnect();
@@ -292,7 +292,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#close(ChannelHandlerContext, ChannelPromise)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelFuture close();
@@ -304,7 +304,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#deregister(ChannelHandlerContext, ChannelPromise)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*
*/
@@ -319,7 +319,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#bind(ChannelHandlerContext, SocketAddress, ChannelPromise)} method
- * called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelFuture bind(SocketAddress localAddress, ChannelPromise promise);
@@ -337,7 +337,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelFuture connect(SocketAddress remoteAddress, ChannelPromise promise);
@@ -351,7 +351,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise);
@@ -364,7 +364,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#disconnect(ChannelHandlerContext, ChannelPromise)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelFuture disconnect(ChannelPromise promise);
@@ -379,7 +379,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#close(ChannelHandlerContext, ChannelPromise)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelFuture close(ChannelPromise promise);
@@ -393,7 +393,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#deregister(ChannelHandlerContext, ChannelPromise)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
@Deprecated
@@ -408,7 +408,7 @@ public interface ChannelHandlerContext extends AttributeMap {
*
* This will result in having the
* {@link ChannelOutboundHandler#read(ChannelHandlerContext)}
- * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
+ * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the
* {@link Channel}.
*/
ChannelHandlerContext read();
diff --git a/transport/src/main/java/io/netty/channel/ChannelHandlerInvoker.java b/transport/src/main/java/io/netty/channel/ChannelHandlerInvoker.java
index 4668440835..8acdf6d2a2 100644
--- a/transport/src/main/java/io/netty/channel/ChannelHandlerInvoker.java
+++ b/transport/src/main/java/io/netty/channel/ChannelHandlerInvoker.java
@@ -23,7 +23,7 @@ import java.net.SocketAddress;
/**
* Invokes the event handler methods of {@link ChannelInboundHandler} and {@link ChannelOutboundHandler}.
* A user can specify a {@link ChannelHandlerInvoker} to implement a custom thread model unsupported by the default
- * implementation.
+ * implementation. Note that the methods in this interface are not intended to be called by a user.
*/
public interface ChannelHandlerInvoker {
diff --git a/transport/src/main/java/io/netty/channel/embedded/EmbeddedEventLoop.java b/transport/src/main/java/io/netty/channel/embedded/EmbeddedEventLoop.java
index c4c6f682f9..db8d3a0f04 100644
--- a/transport/src/main/java/io/netty/channel/embedded/EmbeddedEventLoop.java
+++ b/transport/src/main/java/io/netty/channel/embedded/EmbeddedEventLoop.java
@@ -126,6 +126,11 @@ final class EmbeddedEventLoop extends AbstractEventLoop implements ChannelHandle
invokeChannelRegisteredNow(ctx);
}
+ @Override
+ public void invokeChannelUnregistered(ChannelHandlerContext ctx) {
+ invokeChannelUnregisteredNow(ctx);
+ }
+
@Override
public void invokeChannelActive(ChannelHandlerContext ctx) {
invokeChannelActiveNow(ctx);
@@ -136,11 +141,6 @@ final class EmbeddedEventLoop extends AbstractEventLoop implements ChannelHandle
invokeChannelInactiveNow(ctx);
}
- @Override
- public void invokeChannelUnregistered(ChannelHandlerContext ctx) {
- invokeChannelUnregisteredNow(ctx);
- }
-
@Override
public void invokeExceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
invokeExceptionCaughtNow(ctx, cause);
diff --git a/transport/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java
index 751ad6ec48..6e23334e29 100644
--- a/transport/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java
+++ b/transport/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java
@@ -143,6 +143,7 @@ public class DefaultDatagramChannelConfig extends DefaultChannelConfig implement
}
this.activeOnOpen = activeOnOpen;
}
+
@Override
public boolean isBroadcast() {
try {
diff --git a/transport/src/main/java/io/netty/channel/socket/nio/NioSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/nio/NioSocketChannel.java
index 456714e712..40a0019193 100644
--- a/transport/src/main/java/io/netty/channel/socket/nio/NioSocketChannel.java
+++ b/transport/src/main/java/io/netty/channel/socket/nio/NioSocketChannel.java
@@ -67,7 +67,7 @@ public class NioSocketChannel extends AbstractNioByteChannel implements io.netty
* Create a new instance
*/
public NioSocketChannel() {
- this(newSocket(DEFAULT_SELECTOR_PROVIDER));
+ this(DEFAULT_SELECTOR_PROVIDER);
}
/**
diff --git a/transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java b/transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java
index 53eacaef4d..281cedc154 100644
--- a/transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java
+++ b/transport/src/test/java/io/netty/channel/SingleThreadEventLoopTest.java
@@ -39,8 +39,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
public class SingleThreadEventLoopTest {
diff --git a/transport/src/test/java/io/netty/channel/local/LocalTransportThreadModelTest.java b/transport/src/test/java/io/netty/channel/local/LocalTransportThreadModelTest.java
index 4ac3047a32..b3bb3219c9 100644
--- a/transport/src/test/java/io/netty/channel/local/LocalTransportThreadModelTest.java
+++ b/transport/src/test/java/io/netty/channel/local/LocalTransportThreadModelTest.java
@@ -90,7 +90,7 @@ public class LocalTransportThreadModelTest {
EventExecutorGroup e2 = new DefaultEventExecutorGroup(4, new DefaultThreadFactory("e2"));
ThreadNameAuditor h1 = new ThreadNameAuditor();
ThreadNameAuditor h2 = new ThreadNameAuditor();
- ThreadNameAuditor h3 = new ThreadNameAuditor();
+ ThreadNameAuditor h3 = new ThreadNameAuditor(true);
Channel ch = new LocalChannel();
// With no EventExecutor specified, h1 will be always invoked by EventLoop 'l'.
@@ -361,6 +361,15 @@ public class LocalTransportThreadModelTest {
private final Queue