-
- **/sctp/*.java
-
-
-
-
- maven-resources-plugin
- 2.5
-
- UTF-8
-
-
-
- copy-legal-info
- validate
-
- copy-resources
-
-
- ${basedir}/target/license/META-INF
-
-
- ${basedir}
- false
-
- LICENSE.txt
- NOTICE.txt
- license/*.txt
-
-
-
-
-
-
-
-
- maven-surefire-plugin
- 2.10
-
- once
-
- **/Abstract*
- **/TestUtil*
-
-
-
-
- org.apache.felix
- maven-bundle-plugin
- 2.3.4
- true
-
-
- ${project.groupId}
- ${project.url}
-
- ${project.groupId}.container.osgi.NettyBundleActivator
-
-
- !${project.groupId}.example.*,
- !${project.groupId}.util.internal.*,
- ${project.groupId}.*;version=${project.version}
-
-
- ${project.groupId}.example.*,
- ${project.groupId}.util.internal.*,
-
-
- *;resolution:=optional
-
- registered
- registered
- ${project.groupId}.util.Version
-
-
-
-
- maven-source-plugin
- 2.1.2
-
-
- attach-source
- package
-
- jar
-
-
- true
-
-
-
-
-
- maven-antrun-plugin
- 1.7
-
-
- write-version
- validate
-
- run
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Build number: ${buildNumber}
-
-
-
-
-
-
-
- remove-examples
- package
-
- run
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- org.apache.ant
- ant
- 1.8.2
-
-
- org.apache.ant
- ant-launcher
- 1.8.2
-
-
- ant-contrib
- ant-contrib
- 1.0b3
-
-
- ant
- ant
-
-
-
-
-
-
- maven-javadoc-plugin
- 2.8
-
-
- attach-javadoc
- package
-
- jar
-
-
-
-
- org.jboss.apiviz.APIviz
- ${basedir}/lib/apiviz-1.3.1.GA.jar
- true
- ${basedir}/src/javadoc
- true
- true
- ${project.build.directory}/api
- UTF-8
- UTF-8
- true
- false
- false
- true
- ${basedir}/src/javadoc/overview.html
- ${project.name} API Reference (${project.version})
- ${project.name} API Reference (${project.version})
-
- -link http://java.sun.com/javase/6/docs/api/
- -link http://code.google.com/apis/protocolbuffers/docs/reference/java/
- -link http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/
- -link http://www.osgi.org/javadoc/r4v41/
- -link http://www.slf4j.org/apidocs/
- -link http://commons.apache.org/logging/commons-logging-1.1.1/apidocs/
- -link http://logging.apache.org/log4j/1.2/apidocs/
-
- -group "Low-level data representation" ${project.groupId}.buffer*
- -group "Central interface for all I/O operations" ${project.groupId}.channel*
- -group "Client & Server bootstrapping utilities" ${project.groupId}.bootstrap*
- -group "Reusable I/O event interceptors" ${project.groupId}.handler*
- -group "Miscellaneous" ${project.groupId}.logging*:${project.groupId}.util*
-
- -sourceclasspath ${project.build.outputDirectory}
- -nopackagediagram
-
- UTF-8
- en_US
- ${project.groupId}.example*:${project.groupId}.container*:${project.groupId}.util.internal*
-
-
-
- maven-jxr-plugin
- 2.2
-
-
- generate-xref
- package
-
- jxr
-
-
-
-
- UTF-8
- UTF-8
- true
- ${project.build.directory}/xref
- ${project.build.directory}/api
- ${project.name} Source Xref (${project.version})
- ${project.name} Source Xref (${project.version})
-
-
-
- maven-assembly-plugin
- 2.2.1
-
-
- generate-distribution
- package
-
- single
-
-
-
-
-
- ${basedir}/src/assembly/default.xml
-
- ${attach-distribution}
- true
- gnu
-
-
-
- maven-gpg-plugin
- 1.4
-
-
- sign-artifacts
- verify
-
- sign
-
-
-
-
-
- maven-release-plugin
- 2.2.1
-
-
- false
-
- -Prelease
-
-
-
- maven-eclipse-plugin
- 2.8
-
- true
- true
diff --git a/src/assembly/default.xml b/src/assembly/default.xml
deleted file mode 100644
index bc23c01229..0000000000
--- a/src/assembly/default.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
- dist
-
- tar.bz2
-
- false
-
-
-
-
- **/README*
- **/LICENSE*
- **/NOTICE*
- **/COPYRIGHT*
- **/*.txt
- **/*.xml
- **/license/**
- **/src/**
-
-
- **/target/**
- **/.*/**
-
-
-
-
-
- target
- jar
-
- ${project.build.finalName}*.jar
-
-
- ${project.build.finalName}*-javadoc.jar
-
-
-
-
-
- target/api
- doc/api
-
- **/**
-
-
-
-
-
- target/xref
- doc/xref
-
- **/**
-
-
-
-
-
diff --git a/src/javadoc/overview.html b/src/javadoc/overview.html
deleted file mode 100644
index 2400b25973..0000000000
--- a/src/javadoc/overview.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- The Netty Project API Reference
-
-
-
-The Netty project is an effort to provide an asynchronous event-driven network application framework and tools for rapid development of maintainable high performance and high scalability protocol servers and clients. In other words, Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. It greatly simplifies and streamlines network programming such as TCP/IP socket server.
-
-
diff --git a/src/main/java/io/netty/container/osgi/NettyBundleActivator.java b/src/main/java/io/netty/container/osgi/NettyBundleActivator.java
deleted file mode 100644
index 8b2f66fd3a..0000000000
--- a/src/main/java/io/netty/container/osgi/NettyBundleActivator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.container.osgi;
-
-import io.netty.logging.InternalLoggerFactory;
-import io.netty.logging.OsgiLoggerFactory;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * An OSGi {@link BundleActivator} that configures logging.
- */
-public class NettyBundleActivator implements BundleActivator {
-
- private OsgiLoggerFactory loggerFactory;
-
- @Override
- public void start(BundleContext ctx) throws Exception {
- // Switch the internal logger to the OSGi LogService.
- loggerFactory = new OsgiLoggerFactory(ctx);
- InternalLoggerFactory.setDefaultFactory(loggerFactory);
- }
-
- @Override
- public void stop(BundleContext ctx) throws Exception {
- if (loggerFactory != null) {
- InternalLoggerFactory.setDefaultFactory(loggerFactory.getFallback());
- loggerFactory.destroy();
- loggerFactory = null;
- }
- }
-}
diff --git a/src/main/java/io/netty/util/DebugUtil.java b/src/main/java/io/netty/util/DebugUtil.java
deleted file mode 100644
index 773740c083..0000000000
--- a/src/main/java/io/netty/util/DebugUtil.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.util;
-
-import io.netty.channel.ChannelPipeline;
-import io.netty.channel.ChannelSink;
-import io.netty.util.internal.SystemPropertyUtil;
-
-/**
- * Determines if Netty is running in a debug mode or not. Please note that
- * this is not a Java debug mode. You can enable Netty debug mode by
- * specifying the {@code "io.netty.debug"} system property (e.g.
- * {@code java -Dio.netty.debug ...})
- *
- * If debug mode is disabled (default), the stack trace of the exceptions are
- * compressed to help debugging a user application.
- *
- * If debug mode is enabled, the stack trace of the exceptions raised in
- * {@link ChannelPipeline} or {@link ChannelSink} are retained as it is to help
- * debugging Netty.
- */
-public class DebugUtil {
-
- /**
- * Returns {@code true} if and only if Netty debug mode is enabled.
- */
- public static boolean isDebugEnabled() {
- String value;
- try {
- value = SystemPropertyUtil.get("io.netty.debug");
- } catch (Exception e) {
- value = null;
- }
-
- if (value == null) {
- return false;
- }
-
- value = value.trim().toUpperCase();
- return !value.startsWith("N") &&
- !value.startsWith("F") &&
- !value.equals("0");
- }
-
- private DebugUtil() {
- // Unused
- }
-}
diff --git a/src/main/java/io/netty/util/NamedThreadFactory.java b/src/main/java/io/netty/util/NamedThreadFactory.java
deleted file mode 100644
index 33fa15e084..0000000000
--- a/src/main/java/io/netty/util/NamedThreadFactory.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.util;
-
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import io.netty.channel.ChannelFactory;
-import io.netty.channel.socket.nio.NioServerSocketChannelFactory;
-
-/**
- * A {@link ThreadFactory} that creates a new {@link Thread} with the specified name and thread ID.
- * This class is useful when you want to customize the name of the I/O threads:
- *
- * {@link ChannelFactory} f = new {@link NioServerSocketChannelFactory}(
- * {@link Executors}.{@link Executors#newCachedThreadPool(java.util.concurrent.ThreadFactory) newCachedThreadPool}(new {@link NamedThreadFactory}("myServerBoss-")),
- * {@link Executors}.{@link Executors#newCachedThreadPool(java.util.concurrent.ThreadFactory) newCachedThreadPool}(new {@link NamedThreadFactory}("myServerWorker-")));
- *
- */
-public class NamedThreadFactory implements ThreadFactory {
-
- private final ThreadGroup group;
- private final AtomicInteger threadId = new AtomicInteger(1);
- private final String prefix;
- private final boolean daemon;
- private final int priority;
-
- /**
- * Creates a new factory that creates a {@link Thread} with the specified name prefix.
- *
- * @param prefix the prefix of the new thread's name
- */
- public NamedThreadFactory(String prefix) {
- this(prefix, false, Thread.NORM_PRIORITY);
- }
-
- /**
- * Creates a new factory that creates a {@link Thread} with the specified name prefix.
- *
- * @param prefix the prefix of the new thread's name
- * @param daemon {@code true} if the new thread is a daemon thread
- * @param priority the priority of the new thread
- */
- public NamedThreadFactory(String prefix, boolean daemon, int priority) {
- if (prefix == null) {
- throw new NullPointerException("prefix");
- }
- if (priority < Thread.MIN_PRIORITY || priority > Thread.MAX_PRIORITY) {
- throw new IllegalArgumentException(
- "priority: " + priority +
- " (expected: >= " + Thread.MIN_PRIORITY + " && <= " + Thread.MAX_PRIORITY + ')');
- }
-
- this.prefix = prefix;
- this.daemon = daemon;
- this.priority = priority;
-
- SecurityManager s = System.getSecurityManager();
- if (s != null) {
- group = s.getThreadGroup();
- } else {
- group = Thread.currentThread().getThreadGroup();
- }
- }
-
- /**
- * {@inheritDoc} The name of the thread is {@code "prefix + threadId"}. (e.g. {@code "ioThread-1"} if
- * {@code prefix} is {@code "ioThread-"}.
- */
- @Override
- public Thread newThread(Runnable r) {
- Thread t = new Thread(group, r, prefix + threadId.getAndIncrement());
- t.setDaemon(daemon);
- t.setPriority(priority);
- return t;
- }
-}
diff --git a/src/main/java/io/netty/util/VirtualExecutorService.java b/src/main/java/io/netty/util/VirtualExecutorService.java
deleted file mode 100644
index 3326d1b728..0000000000
--- a/src/main/java/io/netty/util/VirtualExecutorService.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.util;
-
-import java.util.Collections;
-import java.util.IdentityHashMap;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.AbstractExecutorService;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.TimeUnit;
-
-import io.netty.channel.ChannelFactory;
-import io.netty.channel.socket.nio.NioServerSocketChannelFactory;
-
-
-/**
- * A delegating {@link ExecutorService} with its own termination management.
- *
- * {@link VirtualExecutorService} is used when you want to inject an
- * {@link ExecutorService} but you do not want to allow the explicit termination
- * of threads on shutdown request. It is particularly useful when the
- * {@link ExecutorService} to inject is shared by different components and
- * the life cycle of the components depend on the termination of the injected
- * {@link ExecutorService}.
- *
- *
- * ExecutorService globalExecutor = ...;
- * ExecutorService virtualExecutor = new {@link VirtualExecutorService}(globalExecutor);
- *
- * {@link ChannelFactory} factory =
- * new {@link NioServerSocketChannelFactory}(virtualExecutor, virtualExecutor);
- * ...
- *
- * // ChannelFactory.releaseExternalResources() shuts down the executor and
- * // interrupts the I/O threads to terminate all I/O tasks and to release all
- * // resources acquired by ChannelFactory.
- * factory.releaseExternalResources();
- *
- * // Note that globalExecutor is not shut down because VirtualExecutorService
- * // implements its own termination management. All threads which were acquired
- * // by ChannelFactory via VirtualExecutorService are returned to the pool.
- * assert !globalExecutor.isShutdown();
- *
- *
- * The differences from an ordinary {@link ExecutorService}
- *
- * A shutdown request ({@link #shutdown()} or {@link #shutdownNow()}) does not
- * shut down its parent {@link Executor} but simply sets its internal flag to
- * reject further execution request.
- *
- * {@link #shutdownNow()} interrupts only the thread which is executing the
- * task executed via {@link VirtualExecutorService}.
- *
- * {@link #awaitTermination(long, TimeUnit)} does not wait for real thread
- * termination but wait until {@link VirtualExecutorService} is shut down and
- * its active tasks are finished and the threads are returned to the parent
- * {@link Executor}.
- * @apiviz.landmark
- */
-public class VirtualExecutorService extends AbstractExecutorService {
-
- private final Executor e;
- private final ExecutorService s;
- final Object startStopLock = new Object();
- volatile boolean shutdown;
- Set activeThreads = new MapBackedSet(new IdentityHashMap());
-
- /**
- * Creates a new instance with the specified parent {@link Executor}.
- */
- public VirtualExecutorService(Executor parent) {
- if (parent == null) {
- throw new NullPointerException("parent");
- }
-
- if (parent instanceof ExecutorService) {
- e = null;
- s = (ExecutorService) parent;
- } else {
- e = parent;
- s = null;
- }
- }
-
- @Override
- public boolean isShutdown() {
- synchronized (startStopLock) {
- return shutdown;
- }
- }
-
- @Override
- public boolean isTerminated() {
- synchronized (startStopLock) {
- return shutdown && activeThreads.isEmpty();
- }
- }
-
- @Override
- public void shutdown() {
- synchronized (startStopLock) {
- if (shutdown) {
- return;
- }
- shutdown = true;
- }
- }
-
- @Override
- public List shutdownNow() {
- synchronized (startStopLock) {
- if (!isTerminated()) {
- shutdown();
- for (Thread t: activeThreads) {
- t.interrupt();
- }
- }
- }
-
- return Collections.emptyList();
- }
-
- @Override
- public boolean awaitTermination(long timeout, TimeUnit unit)
- throws InterruptedException {
- synchronized (startStopLock) {
- while (!isTerminated()) {
- startStopLock.wait(TimeUnit.MILLISECONDS.convert(timeout, unit));
- }
-
- return isTerminated();
- }
- }
-
- @Override
- public void execute(Runnable command) {
- if (command == null) {
- throw new NullPointerException("command");
- }
-
- if (shutdown) {
- throw new RejectedExecutionException();
- }
-
- if (s != null) {
- s.execute(new ChildExecutorRunnable(command));
- } else {
- e.execute(new ChildExecutorRunnable(command));
- }
- }
-
- private class ChildExecutorRunnable implements Runnable {
-
- private final Runnable runnable;
-
- ChildExecutorRunnable(Runnable runnable) {
- this.runnable = runnable;
- }
-
- @Override
- public void run() {
- Thread thread = Thread.currentThread();
- synchronized (startStopLock) {
- activeThreads.add(thread);
- }
- try {
- runnable.run();
- } finally {
- synchronized (startStopLock) {
- boolean removed = activeThreads.remove(thread);
- assert removed;
- if (isTerminated()) {
- startStopLock.notifyAll();
- }
- }
- }
- }
- }
-}
diff --git a/src/main/java/io/netty/util/internal/StackTraceSimplifier.java b/src/main/java/io/netty/util/internal/StackTraceSimplifier.java
deleted file mode 100644
index 3146416dc1..0000000000
--- a/src/main/java/io/netty/util/internal/StackTraceSimplifier.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.util.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import io.netty.channel.DefaultChannelPipeline;
-import io.netty.channel.SimpleChannelHandler;
-import io.netty.channel.StaticChannelPipeline;
-import io.netty.util.DebugUtil;
-
-/**
- * Simplifies an exception stack trace by removing unnecessary
- * {@link StackTraceElement}s. Please note that the stack trace simplification
- * is disabled if {@linkplain DebugUtil debug mode} is turned on.
- */
-public class StackTraceSimplifier {
-
- private static final boolean SIMPLIFY_STACK_TRACE = !DebugUtil.isDebugEnabled();
- private static final Pattern EXCLUDED_STACK_TRACE =
- Pattern.compile(
- "^io\\.netty\\." +
- "(util\\.internal\\.DeadLockProofWorker" +
- "|channel\\.(SimpleChannel(Upstream|Downstream)?Handler|(Default|Static)ChannelPipeline.*))(\\$.*)?$");
-
- /**
- * Removes unnecessary {@link StackTraceElement}s from the specified
- * exception. {@link SimpleChannelHandler}, {@link DefaultChannelPipeline},
- * and {@link StaticChannelPipeline} will be dropped from the trace.
- */
- public static void simplify(Throwable e) {
- if (!SIMPLIFY_STACK_TRACE) {
- return;
- }
-
- if (e.getCause() != null) {
- simplify(e.getCause());
- }
-
- StackTraceElement[] trace = e.getStackTrace();
- if (trace == null || trace.length == 0) {
- return;
- }
-
- // Perhaps Netty bug. Let us not strip things out.
- if (EXCLUDED_STACK_TRACE.matcher(trace[0].getClassName()).matches()) {
- return;
- }
-
- List simpleTrace =
- new ArrayList(trace.length);
-
- simpleTrace.add(trace[0]);
-
- // Remove unnecessary stack trace elements.
- for (int i = 1; i < trace.length; i ++) {
- if (EXCLUDED_STACK_TRACE.matcher(trace[i].getClassName()).matches()) {
- continue;
- }
- simpleTrace.add(trace[i]);
- }
-
- e.setStackTrace(
- simpleTrace.toArray(new StackTraceElement[simpleTrace.size()]));
- }
-}
diff --git a/src/site/template.vm b/src/site/template.vm
deleted file mode 100644
index 6b7fbee917..0000000000
--- a/src/site/template.vm
+++ /dev/null
@@ -1,26 +0,0 @@
-#*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *#
-
-
-
- $project.name - Redirecting...
-
-
-
-
- Please click here if not redirected automatically.
-
-
diff --git a/src/test/java/io/netty/channel/socket/nio/NioDatagramChannelTest.java b/src/test/java/io/netty/channel/socket/nio/NioDatagramChannelTest.java
deleted file mode 100644
index ffb89db37f..0000000000
--- a/src/test/java/io/netty/channel/socket/nio/NioDatagramChannelTest.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.channel.socket.nio;
-
-import static org.junit.Assert.*;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.InetSocketAddress;
-import java.util.concurrent.Executors;
-
-import io.netty.bootstrap.ConnectionlessBootstrap;
-import io.netty.buffer.ChannelBuffers;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelFuture;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests NIO (UDP) datagrams
- */
-public class NioDatagramChannelTest {
- private static Channel sc;
-
- private static InetSocketAddress inetSocketAddress;
-
- @BeforeClass
- public static void setupChannel() {
- final NioDatagramChannelFactory channelFactory = new NioDatagramChannelFactory(
- Executors.newCachedThreadPool());
- final ConnectionlessBootstrap sb = new ConnectionlessBootstrap(channelFactory);
- inetSocketAddress = new InetSocketAddress("localhost", 9999);
- sc = sb.bind(inetSocketAddress);
- final SimpleHandler handler = new SimpleHandler();
- sc.getPipeline().addFirst("handler", handler);
- }
-
- @Test
- public void checkBoundPort() throws Throwable {
- final InetSocketAddress socketAddress = (InetSocketAddress) sc
- .getLocalAddress();
- assertEquals(9999, socketAddress.getPort());
- }
-
- @Test
- public void sendReciveOne() throws Throwable {
- final String expectedPayload = "some payload";
- sendRecive(expectedPayload);
- }
-
- @Test
- public void sendReciveMultiple() throws Throwable {
- final String expectedPayload = "some payload";
- for (int i = 0; i < 1000; i ++) {
- sendRecive(expectedPayload);
- }
- }
-
- public void clientBootstrap() {
- final NioDatagramChannelFactory channelFactory = new NioDatagramChannelFactory(
- Executors.newCachedThreadPool());
- final ConnectionlessBootstrap bootstrap = new ConnectionlessBootstrap(channelFactory);
- bootstrap.getPipeline().addLast("test", new SimpleHandler());
- bootstrap.setOption("tcpNoDelay", true);
- bootstrap.setOption("keepAlive", true);
- InetSocketAddress clientAddress = new InetSocketAddress("localhost",
- 8888);
- bootstrap.setOption("localAddress", clientAddress);
-
- ChannelFuture ccf = bootstrap.connect(inetSocketAddress);
- ccf.awaitUninterruptibly();
-
- Channel cc = ccf.getChannel();
- final String payload = "client payload";
- ChannelFuture write = cc.write(ChannelBuffers.wrappedBuffer(payload
- .getBytes(), 0, payload.length()));
- write.awaitUninterruptibly();
- }
-
- @AfterClass
- public static void closeChannel() {
- if (sc != null) {
- final ChannelFuture future = sc.close();
- if (future != null) {
- future.awaitUninterruptibly();
- }
- }
- }
-
- private void sendRecive(final String expectedPayload) throws IOException {
- final UdpClient udpClient = new UdpClient(inetSocketAddress
- .getAddress(), inetSocketAddress.getPort());
- final DatagramPacket dp = udpClient.send(expectedPayload.getBytes());
-
- dp.setData(new byte[expectedPayload.length()]);
- assertFalse("The payload should have been cleared", expectedPayload
- .equals(new String(dp.getData())));
-
- udpClient.receive(dp, 4000);
-
- assertEquals(expectedPayload, new String(dp.getData()));
- udpClient.close();
- }
-
-}
diff --git a/src/test/java/io/netty/channel/socket/nio/SimpleHandler.java b/src/test/java/io/netty/channel/socket/nio/SimpleHandler.java
deleted file mode 100644
index f624921220..0000000000
--- a/src/test/java/io/netty/channel/socket/nio/SimpleHandler.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.channel.socket.nio;
-
-import io.netty.buffer.ChannelBuffer;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.MessageEvent;
-import io.netty.channel.SimpleChannelHandler;
-
-/**
- * A very simple channel handler
- */
-public class SimpleHandler extends SimpleChannelHandler {
-
- /**
- * Called when a message is received
- *
- * @param ctx The channel handler context
- * @param e The message event
- */
- @Override
- public void messageReceived(final ChannelHandlerContext ctx,
- final MessageEvent e) throws Exception {
- final ChannelBuffer cb = (ChannelBuffer) e.getMessage();
- final byte[] actual = new byte[cb.readableBytes()];
- cb.getBytes(0, actual);
- //System.out.println("TestHandler payload : " + new String(actual));
- ctx.sendDownstream(e);
- }
-}
diff --git a/src/test/java/io/netty/handler/ssl/AbstractSocketSslEchoTest.java b/src/test/java/io/netty/handler/ssl/AbstractSocketSslEchoTest.java
deleted file mode 100644
index 193a8c9f7c..0000000000
--- a/src/test/java/io/netty/handler/ssl/AbstractSocketSslEchoTest.java
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.handler.ssl;
-
-import static org.junit.Assert.*;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.Random;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.atomic.AtomicReference;
-
-import javax.net.ssl.SSLEngine;
-
-import io.netty.bootstrap.ClientBootstrap;
-import io.netty.bootstrap.ServerBootstrap;
-import io.netty.buffer.ChannelBuffer;
-import io.netty.buffer.ChannelBuffers;
-import io.netty.channel.Channel;
-import io.netty.channel.ChannelFactory;
-import io.netty.channel.ChannelFuture;
-import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.ChannelStateEvent;
-import io.netty.channel.ExceptionEvent;
-import io.netty.channel.MessageEvent;
-import io.netty.channel.SimpleChannelUpstreamHandler;
-import io.netty.example.securechat.SecureChatSslContextFactory;
-import io.netty.handler.execution.ExecutionHandler;
-import io.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
-import io.netty.logging.InternalLogger;
-import io.netty.logging.InternalLoggerFactory;
-import io.netty.util.TestUtil;
-import io.netty.util.internal.ExecutorUtil;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-
-/**
- */
-public abstract class AbstractSocketSslEchoTest {
- static final InternalLogger logger =
- InternalLoggerFactory.getInstance(AbstractSocketSslEchoTest.class);
-
- private static final Random random = new Random();
- static final byte[] data = new byte[1048576];
-
- private static ExecutorService executor;
- private static ExecutorService eventExecutor;
-
- static {
- random.nextBytes(data);
- }
-
- @BeforeClass
- public static void init() {
- executor = Executors.newCachedThreadPool();
- eventExecutor = new OrderedMemoryAwareThreadPoolExecutor(16, 0, 0);
- }
-
- @AfterClass
- public static void destroy() {
- ExecutorUtil.terminate(executor, eventExecutor);
- }
-
- protected abstract ChannelFactory newServerSocketChannelFactory(Executor executor);
- protected abstract ChannelFactory newClientSocketChannelFactory(Executor executor);
-
- protected boolean isExecutorRequired() {
- return false;
- }
-
- @Test
- public void testSslEcho() throws Throwable {
- ServerBootstrap sb = new ServerBootstrap(newServerSocketChannelFactory(executor));
- ClientBootstrap cb = new ClientBootstrap(newClientSocketChannelFactory(executor));
-
- EchoHandler sh = new EchoHandler(true);
- EchoHandler ch = new EchoHandler(false);
-
- SSLEngine sse = SecureChatSslContextFactory.getServerContext().createSSLEngine();
- SSLEngine cse = SecureChatSslContextFactory.getClientContext().createSSLEngine();
- sse.setUseClientMode(false);
- cse.setUseClientMode(true);
-
- // Workaround for blocking I/O transport write-write dead lock.
- sb.setOption("receiveBufferSize", 1048576);
- sb.setOption("receiveBufferSize", 1048576);
-
- sb.getPipeline().addFirst("ssl", new SslHandler(sse));
- sb.getPipeline().addLast("handler", sh);
- cb.getPipeline().addFirst("ssl", new SslHandler(cse));
- cb.getPipeline().addLast("handler", ch);
-
- if (isExecutorRequired()) {
- sb.getPipeline().addFirst("executor",new ExecutionHandler(eventExecutor));
- cb.getPipeline().addFirst("executor",new ExecutionHandler(eventExecutor));
- }
-
- Channel sc = sb.bind(new InetSocketAddress(0));
- int port = ((InetSocketAddress) sc.getLocalAddress()).getPort();
-
- ChannelFuture ccf = cb.connect(new InetSocketAddress(TestUtil.getLocalHost(), port));
- ccf.awaitUninterruptibly();
- if (!ccf.isSuccess()) {
- logger.error("Connection attempt failed", ccf.getCause());
- sc.close().awaitUninterruptibly();
- }
- assertTrue(ccf.isSuccess());
-
- Channel cc = ccf.getChannel();
- ChannelFuture hf = cc.getPipeline().get(SslHandler.class).handshake();
- hf.awaitUninterruptibly();
- if (!hf.isSuccess()) {
- logger.error("Handshake failed", hf.getCause());
- sh.channel.close().awaitUninterruptibly();
- ch.channel.close().awaitUninterruptibly();
- sc.close().awaitUninterruptibly();
- }
-
- assertTrue(hf.isSuccess());
-
- for (int i = 0; i < data.length;) {
- int length = Math.min(random.nextInt(1024 * 64), data.length - i);
- cc.write(ChannelBuffers.wrappedBuffer(data, i, length));
- i += length;
- }
-
- while (ch.counter < data.length) {
- if (sh.exception.get() != null) {
- break;
- }
- if (ch.exception.get() != null) {
- break;
- }
-
- try {
- Thread.sleep(1);
- } catch (InterruptedException e) {
- // Ignore.
- }
- }
-
- while (sh.counter < data.length) {
- if (sh.exception.get() != null) {
- break;
- }
- if (ch.exception.get() != null) {
- break;
- }
-
- try {
- Thread.sleep(1);
- } catch (InterruptedException e) {
- // Ignore.
- }
- }
-
- sh.channel.close().awaitUninterruptibly();
- ch.channel.close().awaitUninterruptibly();
- sc.close().awaitUninterruptibly();
-
- if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
- throw sh.exception.get();
- }
- if (ch.exception.get() != null && !(ch.exception.get() instanceof IOException)) {
- throw ch.exception.get();
- }
- if (sh.exception.get() != null) {
- throw sh.exception.get();
- }
- if (ch.exception.get() != null) {
- throw ch.exception.get();
- }
- }
-
- private static class EchoHandler extends SimpleChannelUpstreamHandler {
- volatile Channel channel;
- final AtomicReference exception = new AtomicReference();
- volatile int counter;
- private final boolean server;
-
- EchoHandler(boolean server) {
- this.server = server;
- }
-
- @Override
- public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
- throws Exception {
- channel = e.getChannel();
- }
-
- @Override
- public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
- throws Exception {
- ChannelBuffer m = (ChannelBuffer) e.getMessage();
- byte[] actual = new byte[m.readableBytes()];
- m.getBytes(0, actual);
-
- int lastIdx = counter;
- for (int i = 0; i < actual.length; i ++) {
- assertEquals(data[i + lastIdx], actual[i]);
- }
-
- if (channel.getParent() != null) {
- channel.write(m);
- }
-
- counter += actual.length;
- }
-
- @Override
- public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
- throws Exception {
- logger.warn(
- "Unexpected exception from the " +
- (server? "server" : "client") + " side", e.getCause());
-
- exception.compareAndSet(null, e.getCause());
- e.getChannel().close();
- }
- }
-}
diff --git a/src/test/java/io/netty/util/DebugUtilTest.java b/src/test/java/io/netty/util/DebugUtilTest.java
deleted file mode 100644
index b97c6eae71..0000000000
--- a/src/test/java/io/netty/util/DebugUtilTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.util;
-
-import static org.junit.Assert.*;
-
-import java.security.Permission;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-
-/**
- */
-public class DebugUtilTest {
-
- public void shouldReturnFalseIfPropertyIsNotSet() {
- assertFalse(DebugUtil.isDebugEnabled());
- }
-
- @Test
- public void shouldReturnTrueInDebugMode() {
- System.setProperty("io.netty.debug", "true");
- assertTrue(DebugUtil.isDebugEnabled());
- }
-
- @Test
- public void shouldReturnFalseInNonDebugMode() {
- System.setProperty("io.netty.debug", "false");
- assertFalse(DebugUtil.isDebugEnabled());
- }
-
- @Test
- public void shouldNotBombOutWhenSecurityManagerIsInAction() {
- System.setProperty("io.netty.debug", "true");
- System.setSecurityManager(new SecurityManager() {
- @Override
- public void checkPropertyAccess(String key) {
- throw new SecurityException();
- }
-
- @Override
- public void checkPermission(Permission perm, Object context) {
- // Allow
- }
-
- @Override
- public void checkPermission(Permission perm) {
- // Allow
- }
-
- });
- try {
- assertFalse(DebugUtil.isDebugEnabled());
- } finally {
- System.setSecurityManager(null);
- }
- }
-
- @Before @After
- public void cleanup() {
- System.clearProperty("io.netty.debug");
- }
-}
diff --git a/src/test/java/io/netty/util/internal/StackTraceSimplifierTest.java b/src/test/java/io/netty/util/internal/StackTraceSimplifierTest.java
deleted file mode 100644
index de7eb91181..0000000000
--- a/src/test/java/io/netty/util/internal/StackTraceSimplifierTest.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 2011 The Netty Project
- *
- * The Netty Project licenses this file to you under the Apache License,
- * version 2.0 (the "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations
- * under the License.
- */
-package io.netty.util.internal;
-
-import static org.easymock.EasyMock.*;
-import static org.junit.Assert.*;
-
-import io.netty.buffer.ChannelBuffer;
-import io.netty.channel.Channel;
-import io.netty.channel.DefaultChannelPipeline;
-import io.netty.channel.SimpleChannelHandler;
-import org.junit.Test;
-
-
-/**
- */
-public class StackTraceSimplifierTest {
-
- @Test
- public void testBasicSimplification() {
- Exception e = new Exception();
- e.setStackTrace(new StackTraceElement[] {
- new StackTraceElement(ChannelBuffer.class.getName(), "a", null, 1),
- new StackTraceElement("com.example.Foo", "b", null, 1),
- new StackTraceElement(SimpleChannelHandler.class.getName(), "c", null, 1),
- });
-
- StackTraceSimplifier.simplify(e);
-
- StackTraceElement[] simplified = e.getStackTrace();
- assertEquals(2, simplified.length);
- assertEquals(ChannelBuffer.class.getName(), simplified[0].getClassName());
- assertEquals("com.example.Foo", simplified[1].getClassName());
- }
-
- @Test
- public void testNestedSimplification() {
- Exception e1 = new Exception();
- e1.setStackTrace(new StackTraceElement[] {
- new StackTraceElement(ChannelBuffer.class.getName(), "a", null, 1),
- new StackTraceElement("com.example.Foo", "b", null, 1),
- new StackTraceElement(SimpleChannelHandler.class.getName(), "c", null, 1),
- new StackTraceElement(DefaultChannelPipeline.class.getName(), "d", null, 1),
- });
-
- Exception e2 = new Exception(e1);
- e2.setStackTrace(new StackTraceElement[] {
- new StackTraceElement(Channel.class.getName(), "a", null, 1),
- new StackTraceElement("com.example.Bar", "b", null, 1),
- new StackTraceElement(SimpleChannelHandler.class.getName(), "c", null, 1),
- new StackTraceElement(DefaultChannelPipeline.class.getName(), "d", null, 1),
- });
-
- StackTraceSimplifier.simplify(e2);
-
- StackTraceElement[] simplified1 = e1.getStackTrace();
- assertEquals(2, simplified1.length);
- assertEquals(ChannelBuffer.class.getName(), simplified1[0].getClassName());
- assertEquals("com.example.Foo", simplified1[1].getClassName());
-
- StackTraceElement[] simplified2 = e2.getStackTrace();
- assertEquals(2, simplified2.length);
- assertEquals(Channel.class.getName(), simplified2[0].getClassName());
- assertEquals("com.example.Bar", simplified2[1].getClassName());
- }
-
- @Test
- public void testNettyBugDetection() {
- Exception e = new Exception();
- e.setStackTrace(new StackTraceElement[] {
- new StackTraceElement(DefaultChannelPipeline.class.getName(), "a", null, 1),
- new StackTraceElement(ChannelBuffer.class.getName(), "a", null, 1),
- new StackTraceElement("com.example.Foo", "b", null, 1),
- new StackTraceElement(SimpleChannelHandler.class.getName(), "c", null, 1),
- });
-
- StackTraceSimplifier.simplify(e);
-
- StackTraceElement[] simplified = e.getStackTrace();
- for (StackTraceElement ste: simplified) {
- System.out.println(ste);
- }
- assertEquals(4, simplified.length);
- }
-
- @Test
- public void testEmptyStackTrace() {
- Exception e = new Exception();
- e.setStackTrace(new StackTraceElement[0]);
-
- StackTraceSimplifier.simplify(e);
- assertEquals(0, e.getStackTrace().length);
- }
-
-
- @Test
- public void testNullStackTrace() {
- Exception e = createNiceMock(Exception.class);
- expect(e.getStackTrace()).andReturn(null).anyTimes();
- replay(e);
-
- StackTraceSimplifier.simplify(e);
- assertNull(e.getStackTrace());
- verify(e);
- }
-}
diff --git a/testsuite/pom.xml b/testsuite/pom.xml
new file mode 100644
index 0000000000..3b541f4cf0
--- /dev/null
+++ b/testsuite/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+ io.netty
+ netty-parent
+ 4.0.0.Alpha1-SNAPSHOT
+
+
+ io.netty
+ netty-testsuite
+ jar
+
+ Netty/Testsuite
+
+
+
+ ${project.groupId}
+ netty-handler
+ ${project.version}
+
+
+
+
+
+
+
+
diff --git a/src/test/java/io/netty/bootstrap/AbstractSocketClientBootstrapTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketClientBootstrapTest.java
similarity index 84%
rename from src/test/java/io/netty/bootstrap/AbstractSocketClientBootstrapTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketClientBootstrapTest.java
index fb80aaae2f..a362933930 100644
--- a/src/test/java/io/netty/bootstrap/AbstractSocketClientBootstrapTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketClientBootstrapTest.java
@@ -13,9 +13,8 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.bootstrap;
+package io.netty.testsuite.transport.socket;
-import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import java.io.IOException;
@@ -25,16 +24,19 @@ import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import org.easymock.EasyMock;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import io.netty.bootstrap.ClientBootstrap;
import io.netty.channel.ChannelFactory;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelPipelineException;
import io.netty.channel.ChannelPipelineFactory;
-import io.netty.util.DummyHandler;
-import io.netty.util.TestUtil;
+import io.netty.testsuite.util.DummyHandler;
+import io.netty.util.SocketAddresses;
import io.netty.util.internal.ExecutorUtil;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
/**
@@ -83,7 +85,7 @@ public abstract class AbstractSocketClientBootstrapTest {
bootstrap.setOption(
"remoteAddress",
new InetSocketAddress(
- TestUtil.getLocalHost(),
+ SocketAddresses.LOCALHOST,
serverSocket.socket().getLocalPort()));
ChannelFuture future = bootstrap.connect();
@@ -120,7 +122,7 @@ public abstract class AbstractSocketClientBootstrapTest {
bootstrap.setOption(
"remoteAddress",
new InetSocketAddress(
- TestUtil.getLocalHost(),
+ SocketAddresses.LOCALHOST,
serverSocket.socket().getLocalPort()));
bootstrap.setOption("localAddress", new InetSocketAddress(0));
@@ -145,29 +147,29 @@ public abstract class AbstractSocketClientBootstrapTest {
@Test(expected = ChannelPipelineException.class)
public void testFailedPipelineInitialization() throws Exception {
- ClientBootstrap bootstrap = new ClientBootstrap(createMock(ChannelFactory.class));
- ChannelPipelineFactory pipelineFactory = createMock(ChannelPipelineFactory.class);
+ ClientBootstrap bootstrap = new ClientBootstrap(EasyMock.createMock(ChannelFactory.class));
+ ChannelPipelineFactory pipelineFactory = EasyMock.createMock(ChannelPipelineFactory.class);
bootstrap.setPipelineFactory(pipelineFactory);
- expect(pipelineFactory.getPipeline()).andThrow(new ChannelPipelineException());
- replay(pipelineFactory);
+ EasyMock.expect(pipelineFactory.getPipeline()).andThrow(new ChannelPipelineException());
+ EasyMock.replay(pipelineFactory);
- bootstrap.connect(new InetSocketAddress(TestUtil.getLocalHost(), 1));
+ bootstrap.connect(new InetSocketAddress(SocketAddresses.LOCALHOST, 1));
}
@Test(expected = IllegalStateException.class)
public void shouldHaveRemoteAddressOption() {
- new ClientBootstrap(createMock(ChannelFactory.class)).connect();
+ new ClientBootstrap(EasyMock.createMock(ChannelFactory.class)).connect();
}
@Test(expected = NullPointerException.class)
public void shouldDisallowNullRemoteAddressParameter1() {
- new ClientBootstrap(createMock(ChannelFactory.class)).connect(null);
+ new ClientBootstrap(EasyMock.createMock(ChannelFactory.class)).connect(null);
}
@Test(expected = NullPointerException.class)
public void shouldDisallowNullRemoteAddressParameter2() {
- new ClientBootstrap(createMock(ChannelFactory.class)).connect(null, null);
+ new ClientBootstrap(EasyMock.createMock(ChannelFactory.class)).connect(null, null);
}
}
diff --git a/src/test/java/io/netty/handler/codec/serialization/AbstractSocketCompatibleObjectStreamEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketCompatibleObjectStreamEchoTest.java
similarity index 94%
rename from src/test/java/io/netty/handler/codec/serialization/AbstractSocketCompatibleObjectStreamEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketCompatibleObjectStreamEchoTest.java
index 1d0b24aa46..c0ea5bda83 100644
--- a/src/test/java/io/netty/handler/codec/serialization/AbstractSocketCompatibleObjectStreamEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketCompatibleObjectStreamEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.serialization;
+package io.netty.testsuite.transport.socket;
import static org.junit.Assert.*;
@@ -35,7 +35,9 @@ import io.netty.channel.ChannelStateEvent;
import io.netty.channel.ExceptionEvent;
import io.netty.channel.MessageEvent;
import io.netty.channel.SimpleChannelUpstreamHandler;
-import io.netty.util.TestUtil;
+import io.netty.handler.codec.serialization.CompatibleObjectDecoder;
+import io.netty.handler.codec.serialization.CompatibleObjectEncoder;
+import io.netty.util.SocketAddresses;
import io.netty.util.internal.ExecutorUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -96,7 +98,7 @@ public abstract class AbstractSocketCompatibleObjectStreamEchoTest {
Channel sc = sb.bind(new InetSocketAddress(0));
int port = ((InetSocketAddress) sc.getLocalAddress()).getPort();
- ChannelFuture ccf = cb.connect(new InetSocketAddress(TestUtil.getLocalHost(), port));
+ ChannelFuture ccf = cb.connect(new InetSocketAddress(SocketAddresses.LOCALHOST, port));
assertTrue(ccf.awaitUninterruptibly().isSuccess());
Channel cc = ccf.getChannel();
diff --git a/src/test/java/io/netty/channel/socket/AbstractSocketEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/channel/socket/AbstractSocketEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketEchoTest.java
index b41e33999c..2259805802 100644
--- a/src/test/java/io/netty/channel/socket/AbstractSocketEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket;
+package io.netty.testsuite.transport.socket;
import static org.junit.Assert.*;
@@ -37,7 +37,7 @@ import io.netty.channel.ChannelStateEvent;
import io.netty.channel.ExceptionEvent;
import io.netty.channel.MessageEvent;
import io.netty.channel.SimpleChannelUpstreamHandler;
-import io.netty.util.TestUtil;
+import io.netty.util.SocketAddresses;
import io.netty.util.internal.ExecutorUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -84,7 +84,7 @@ public abstract class AbstractSocketEchoTest {
Channel sc = sb.bind(new InetSocketAddress(0));
int port = ((InetSocketAddress) sc.getLocalAddress()).getPort();
- ChannelFuture ccf = cb.connect(new InetSocketAddress(TestUtil.getLocalHost(), port));
+ ChannelFuture ccf = cb.connect(new InetSocketAddress(SocketAddresses.LOCALHOST, port));
assertTrue(ccf.awaitUninterruptibly().isSuccess());
Channel cc = ccf.getChannel();
diff --git a/src/test/java/io/netty/handler/codec/frame/AbstractSocketFixedLengthEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketFixedLengthEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/frame/AbstractSocketFixedLengthEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketFixedLengthEchoTest.java
index c9bad3eaee..2c93c10f2d 100644
--- a/src/test/java/io/netty/handler/codec/frame/AbstractSocketFixedLengthEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketFixedLengthEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.frame;
+package io.netty.testsuite.transport.socket;
import static org.junit.Assert.*;
@@ -37,7 +37,8 @@ import io.netty.channel.ChannelStateEvent;
import io.netty.channel.ExceptionEvent;
import io.netty.channel.MessageEvent;
import io.netty.channel.SimpleChannelUpstreamHandler;
-import io.netty.util.TestUtil;
+import io.netty.handler.codec.frame.FixedLengthFrameDecoder;
+import io.netty.util.SocketAddresses;
import io.netty.util.internal.ExecutorUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -86,7 +87,7 @@ public abstract class AbstractSocketFixedLengthEchoTest {
Channel sc = sb.bind(new InetSocketAddress(0));
int port = ((InetSocketAddress) sc.getLocalAddress()).getPort();
- ChannelFuture ccf = cb.connect(new InetSocketAddress(TestUtil.getLocalHost(), port));
+ ChannelFuture ccf = cb.connect(new InetSocketAddress(SocketAddresses.LOCALHOST, port));
assertTrue(ccf.awaitUninterruptibly().isSuccess());
Channel cc = ccf.getChannel();
diff --git a/src/test/java/io/netty/handler/codec/serialization/AbstractSocketObjectStreamEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketObjectStreamEchoTest.java
similarity index 95%
rename from src/test/java/io/netty/handler/codec/serialization/AbstractSocketObjectStreamEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketObjectStreamEchoTest.java
index 2051ecea49..8d665b0524 100644
--- a/src/test/java/io/netty/handler/codec/serialization/AbstractSocketObjectStreamEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketObjectStreamEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.serialization;
+package io.netty.testsuite.transport.socket;
import static org.junit.Assert.*;
@@ -35,7 +35,9 @@ import io.netty.channel.ChannelStateEvent;
import io.netty.channel.ExceptionEvent;
import io.netty.channel.MessageEvent;
import io.netty.channel.SimpleChannelUpstreamHandler;
-import io.netty.util.TestUtil;
+import io.netty.handler.codec.serialization.ObjectDecoder;
+import io.netty.handler.codec.serialization.ObjectEncoder;
+import io.netty.util.SocketAddresses;
import io.netty.util.internal.ExecutorUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -95,7 +97,7 @@ public abstract class AbstractSocketObjectStreamEchoTest {
Channel sc = sb.bind(new InetSocketAddress(0));
int port = ((InetSocketAddress) sc.getLocalAddress()).getPort();
- ChannelFuture ccf = cb.connect(new InetSocketAddress(TestUtil.getLocalHost(), port));
+ ChannelFuture ccf = cb.connect(new InetSocketAddress(SocketAddresses.LOCALHOST, port));
assertTrue(ccf.awaitUninterruptibly().isSuccess());
Channel cc = ccf.getChannel();
diff --git a/src/test/java/io/netty/bootstrap/AbstractSocketServerBootstrapTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketServerBootstrapTest.java
similarity index 88%
rename from src/test/java/io/netty/bootstrap/AbstractSocketServerBootstrapTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketServerBootstrapTest.java
index 15edd45227..63438d2be7 100644
--- a/src/test/java/io/netty/bootstrap/AbstractSocketServerBootstrapTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketServerBootstrapTest.java
@@ -13,9 +13,8 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.bootstrap;
+package io.netty.testsuite.transport.socket;
-import static org.easymock.EasyMock.*;
import static org.junit.Assert.*;
import java.io.IOException;
@@ -26,6 +25,8 @@ import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import io.netty.bootstrap.ClientBootstrap;
+import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelException;
import io.netty.channel.ChannelFactory;
@@ -36,9 +37,11 @@ import io.netty.channel.ChildChannelStateEvent;
import io.netty.channel.ServerChannelFactory;
import io.netty.channel.SimpleChannelUpstreamHandler;
import io.netty.channel.socket.SocketChannelConfig;
-import io.netty.util.DummyHandler;
-import io.netty.util.TestUtil;
+import io.netty.testsuite.util.DummyHandler;
+import io.netty.util.SocketAddresses;
import io.netty.util.internal.ExecutorUtil;
+
+import org.easymock.EasyMock;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -127,7 +130,7 @@ public abstract class AbstractSocketServerBootstrapTest {
Socket socket = null;
try {
socket = new Socket(
- TestUtil.getLocalHost(),
+ SocketAddresses.LOCALHOST,
((InetSocketAddress) channel.getLocalAddress()).getPort());
// Wait until the connection is open in the server side.
@@ -176,25 +179,25 @@ public abstract class AbstractSocketServerBootstrapTest {
@Test(expected = ChannelPipelineException.class)
public void testFailedPipelineInitialization() throws Exception {
- ClientBootstrap bootstrap = new ClientBootstrap(createMock(ChannelFactory.class));
- ChannelPipelineFactory pipelineFactory = createMock(ChannelPipelineFactory.class);
+ ClientBootstrap bootstrap = new ClientBootstrap(EasyMock.createMock(ChannelFactory.class));
+ ChannelPipelineFactory pipelineFactory = EasyMock.createMock(ChannelPipelineFactory.class);
bootstrap.setPipelineFactory(pipelineFactory);
- expect(pipelineFactory.getPipeline()).andThrow(new ChannelPipelineException());
- replay(pipelineFactory);
+ EasyMock.expect(pipelineFactory.getPipeline()).andThrow(new ChannelPipelineException());
+ EasyMock.replay(pipelineFactory);
- bootstrap.connect(new InetSocketAddress(TestUtil.getLocalHost(), 1));
+ bootstrap.connect(new InetSocketAddress(SocketAddresses.LOCALHOST, 1));
}
@Test(expected = IllegalStateException.class)
public void shouldHaveLocalAddressOption() {
- new ServerBootstrap(createMock(ServerChannelFactory.class)).bind();
+ new ServerBootstrap(EasyMock.createMock(ServerChannelFactory.class)).bind();
}
@Test(expected = NullPointerException.class)
public void shouldDisallowNullLocalAddressParameter() {
- new ServerBootstrap(createMock(ServerChannelFactory.class)).bind(null);
+ new ServerBootstrap(EasyMock.createMock(ServerChannelFactory.class)).bind(null);
}
private static class ParentChannelHandler extends SimpleChannelUpstreamHandler {
diff --git a/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketSslEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketSslEchoTest.java
new file mode 100644
index 0000000000..08b5d35ce7
--- /dev/null
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketSslEchoTest.java
@@ -0,0 +1,652 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package io.netty.testsuite.transport.socket;
+
+import static org.junit.Assert.*;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.InetSocketAddress;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.Security;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.Random;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicReference;
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.ManagerFactoryParameters;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactorySpi;
+import javax.net.ssl.X509TrustManager;
+
+import io.netty.bootstrap.ClientBootstrap;
+import io.netty.bootstrap.ServerBootstrap;
+import io.netty.buffer.ChannelBuffer;
+import io.netty.buffer.ChannelBuffers;
+import io.netty.channel.Channel;
+import io.netty.channel.ChannelFactory;
+import io.netty.channel.ChannelFuture;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelStateEvent;
+import io.netty.channel.ExceptionEvent;
+import io.netty.channel.MessageEvent;
+import io.netty.channel.SimpleChannelUpstreamHandler;
+import io.netty.handler.execution.ExecutionHandler;
+import io.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
+import io.netty.handler.ssl.SslHandler;
+import io.netty.logging.InternalLogger;
+import io.netty.logging.InternalLoggerFactory;
+import io.netty.util.SocketAddresses;
+import io.netty.util.internal.ExecutorUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ */
+public abstract class AbstractSocketSslEchoTest {
+ static final InternalLogger logger =
+ InternalLoggerFactory.getInstance(AbstractSocketSslEchoTest.class);
+
+ private static final Random random = new Random();
+ static final byte[] data = new byte[1048576];
+
+ private static ExecutorService executor;
+ private static ExecutorService eventExecutor;
+
+ static {
+ random.nextBytes(data);
+ }
+
+ @BeforeClass
+ public static void init() {
+ executor = Executors.newCachedThreadPool();
+ eventExecutor = new OrderedMemoryAwareThreadPoolExecutor(16, 0, 0);
+ }
+
+ @AfterClass
+ public static void destroy() {
+ ExecutorUtil.terminate(executor, eventExecutor);
+ }
+
+ protected abstract ChannelFactory newServerSocketChannelFactory(Executor executor);
+ protected abstract ChannelFactory newClientSocketChannelFactory(Executor executor);
+
+ protected boolean isExecutorRequired() {
+ return false;
+ }
+
+ @Test
+ public void testSslEcho() throws Throwable {
+ ServerBootstrap sb = new ServerBootstrap(newServerSocketChannelFactory(executor));
+ ClientBootstrap cb = new ClientBootstrap(newClientSocketChannelFactory(executor));
+
+ EchoHandler sh = new EchoHandler(true);
+ EchoHandler ch = new EchoHandler(false);
+
+ SSLEngine sse = BogusSslContextFactory.getServerContext().createSSLEngine();
+ SSLEngine cse = BogusSslContextFactory.getClientContext().createSSLEngine();
+ sse.setUseClientMode(false);
+ cse.setUseClientMode(true);
+
+ // Workaround for blocking I/O transport write-write dead lock.
+ sb.setOption("receiveBufferSize", 1048576);
+ sb.setOption("receiveBufferSize", 1048576);
+
+ sb.getPipeline().addFirst("ssl", new SslHandler(sse));
+ sb.getPipeline().addLast("handler", sh);
+ cb.getPipeline().addFirst("ssl", new SslHandler(cse));
+ cb.getPipeline().addLast("handler", ch);
+
+ if (isExecutorRequired()) {
+ sb.getPipeline().addFirst("executor",new ExecutionHandler(eventExecutor));
+ cb.getPipeline().addFirst("executor",new ExecutionHandler(eventExecutor));
+ }
+
+ Channel sc = sb.bind(new InetSocketAddress(0));
+ int port = ((InetSocketAddress) sc.getLocalAddress()).getPort();
+
+ ChannelFuture ccf = cb.connect(new InetSocketAddress(SocketAddresses.LOCALHOST, port));
+ ccf.awaitUninterruptibly();
+ if (!ccf.isSuccess()) {
+ logger.error("Connection attempt failed", ccf.getCause());
+ sc.close().awaitUninterruptibly();
+ }
+ assertTrue(ccf.isSuccess());
+
+ Channel cc = ccf.getChannel();
+ ChannelFuture hf = cc.getPipeline().get(SslHandler.class).handshake();
+ hf.awaitUninterruptibly();
+ if (!hf.isSuccess()) {
+ logger.error("Handshake failed", hf.getCause());
+ sh.channel.close().awaitUninterruptibly();
+ ch.channel.close().awaitUninterruptibly();
+ sc.close().awaitUninterruptibly();
+ }
+
+ assertTrue(hf.isSuccess());
+
+ for (int i = 0; i < data.length;) {
+ int length = Math.min(random.nextInt(1024 * 64), data.length - i);
+ cc.write(ChannelBuffers.wrappedBuffer(data, i, length));
+ i += length;
+ }
+
+ while (ch.counter < data.length) {
+ if (sh.exception.get() != null) {
+ break;
+ }
+ if (ch.exception.get() != null) {
+ break;
+ }
+
+ try {
+ Thread.sleep(1);
+ } catch (InterruptedException e) {
+ // Ignore.
+ }
+ }
+
+ while (sh.counter < data.length) {
+ if (sh.exception.get() != null) {
+ break;
+ }
+ if (ch.exception.get() != null) {
+ break;
+ }
+
+ try {
+ Thread.sleep(1);
+ } catch (InterruptedException e) {
+ // Ignore.
+ }
+ }
+
+ sh.channel.close().awaitUninterruptibly();
+ ch.channel.close().awaitUninterruptibly();
+ sc.close().awaitUninterruptibly();
+
+ if (sh.exception.get() != null && !(sh.exception.get() instanceof IOException)) {
+ throw sh.exception.get();
+ }
+ if (ch.exception.get() != null && !(ch.exception.get() instanceof IOException)) {
+ throw ch.exception.get();
+ }
+ if (sh.exception.get() != null) {
+ throw sh.exception.get();
+ }
+ if (ch.exception.get() != null) {
+ throw ch.exception.get();
+ }
+ }
+
+ private static class EchoHandler extends SimpleChannelUpstreamHandler {
+ volatile Channel channel;
+ final AtomicReference exception = new AtomicReference();
+ volatile int counter;
+ private final boolean server;
+
+ EchoHandler(boolean server) {
+ this.server = server;
+ }
+
+ @Override
+ public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
+ throws Exception {
+ channel = e.getChannel();
+ }
+
+ @Override
+ public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
+ throws Exception {
+ ChannelBuffer m = (ChannelBuffer) e.getMessage();
+ byte[] actual = new byte[m.readableBytes()];
+ m.getBytes(0, actual);
+
+ int lastIdx = counter;
+ for (int i = 0; i < actual.length; i ++) {
+ assertEquals(data[i + lastIdx], actual[i]);
+ }
+
+ if (channel.getParent() != null) {
+ channel.write(m);
+ }
+
+ counter += actual.length;
+ }
+
+ @Override
+ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
+ throws Exception {
+ logger.warn(
+ "Unexpected exception from the " +
+ (server? "server" : "client") + " side", e.getCause());
+
+ exception.compareAndSet(null, e.getCause());
+ e.getChannel().close();
+ }
+ }
+
+ private static class BogusSslContextFactory {
+
+ private static final String PROTOCOL = "TLS";
+ private static final SSLContext SERVER_CONTEXT;
+ private static final SSLContext CLIENT_CONTEXT;
+
+ static {
+ String algorithm = Security.getProperty("ssl.KeyManagerFactory.algorithm");
+ if (algorithm == null) {
+ algorithm = "SunX509";
+ }
+
+ SSLContext serverContext = null;
+ SSLContext clientContext = null;
+ try {
+ KeyStore ks = KeyStore.getInstance("JKS");
+ ks.load(BogusKeyStore.asInputStream(),
+ BogusKeyStore.getKeyStorePassword());
+
+ // Set up key manager factory to use our key store
+ KeyManagerFactory kmf = KeyManagerFactory.getInstance(algorithm);
+ kmf.init(ks, BogusKeyStore.getCertificatePassword());
+
+ // Initialize the SSLContext to work with our key managers.
+ serverContext = SSLContext.getInstance(PROTOCOL);
+ serverContext.init(kmf.getKeyManagers(), null, null);
+ } catch (Exception e) {
+ throw new Error(
+ "Failed to initialize the server-side SSLContext", e);
+ }
+
+ try {
+ clientContext = SSLContext.getInstance(PROTOCOL);
+ clientContext.init(null, BogusTrustManagerFactory.getTrustManagers(), null);
+ } catch (Exception e) {
+ throw new Error(
+ "Failed to initialize the client-side SSLContext", e);
+ }
+
+ SERVER_CONTEXT = serverContext;
+ CLIENT_CONTEXT = clientContext;
+ }
+
+ public static SSLContext getServerContext() {
+ return SERVER_CONTEXT;
+ }
+
+ public static SSLContext getClientContext() {
+ return CLIENT_CONTEXT;
+ }
+ }
+
+ /**
+ * Bogus {@link javax.net.ssl.TrustManagerFactorySpi} which accepts any certificate
+ * even if it is invalid.
+ */
+ private static class BogusTrustManagerFactory extends TrustManagerFactorySpi {
+
+ private static final TrustManager DUMMY_TRUST_MANAGER = new X509TrustManager() {
+ @Override
+ public X509Certificate[] getAcceptedIssuers() {
+ return new X509Certificate[0];
+ }
+
+ @Override
+ public void checkClientTrusted(
+ X509Certificate[] chain, String authType) throws CertificateException {
+ // Always trust - it is an example.
+ // You should do something in the real world.
+ // You will reach here only if you enabled client certificate auth,
+ // as described in SecureChatSslContextFactory.
+ System.err.println(
+ "UNKNOWN CLIENT CERTIFICATE: " + chain[0].getSubjectDN());
+ }
+
+ @Override
+ public void checkServerTrusted(
+ X509Certificate[] chain, String authType) throws CertificateException {
+ // Always trust - it is an example.
+ // You should do something in the real world.
+ System.err.println(
+ "UNKNOWN SERVER CERTIFICATE: " + chain[0].getSubjectDN());
+ }
+ };
+
+ public static TrustManager[] getTrustManagers() {
+ return new TrustManager[] { DUMMY_TRUST_MANAGER };
+ }
+
+ @Override
+ protected TrustManager[] engineGetTrustManagers() {
+ return getTrustManagers();
+ }
+
+ @Override
+ protected void engineInit(KeyStore keystore) throws KeyStoreException {
+ // Unused
+ }
+
+ @Override
+ protected void engineInit(ManagerFactoryParameters managerFactoryParameters)
+ throws InvalidAlgorithmParameterException {
+ // Unused
+ }
+ }
+
+ /**
+ * A bogus key store which provides all the required information to
+ * create an example SSL connection.
+ *
+ * To generate a bogus key store:
+ *
+ * keytool -genkey -alias bogus -keysize 2048 -validity 36500
+ * -keyalg RSA -dname "CN=bogus"
+ * -keypass secret -storepass secret
+ * -keystore cert.jks
+ *
+ */
+ private static class BogusKeyStore {
+ private static final short[] DATA = {
+ 0xfe, 0xed, 0xfe, 0xed, 0x00, 0x00, 0x00, 0x02,
+ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
+ 0x00, 0x07, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c,
+ 0x65, 0x00, 0x00, 0x01, 0x1a, 0x9f, 0x57, 0xa5,
+ 0x27, 0x00, 0x00, 0x01, 0x9a, 0x30, 0x82, 0x01,
+ 0x96, 0x30, 0x0e, 0x06, 0x0a, 0x2b, 0x06, 0x01,
+ 0x04, 0x01, 0x2a, 0x02, 0x11, 0x01, 0x01, 0x05,
+ 0x00, 0x04, 0x82, 0x01, 0x82, 0x48, 0x6d, 0xcf,
+ 0x16, 0xb5, 0x50, 0x95, 0x36, 0xbf, 0x47, 0x27,
+ 0x50, 0x58, 0x0d, 0xa2, 0x52, 0x7e, 0x25, 0xab,
+ 0x14, 0x1a, 0x26, 0x5e, 0x2d, 0x8a, 0x23, 0x90,
+ 0x60, 0x7f, 0x12, 0x20, 0x56, 0xd1, 0x43, 0xa2,
+ 0x6b, 0x47, 0x5d, 0xed, 0x9d, 0xd4, 0xe5, 0x83,
+ 0x28, 0x89, 0xc2, 0x16, 0x4c, 0x76, 0x06, 0xad,
+ 0x8e, 0x8c, 0x29, 0x1a, 0x9b, 0x0f, 0xdd, 0x60,
+ 0x4b, 0xb4, 0x62, 0x82, 0x9e, 0x4a, 0x63, 0x83,
+ 0x2e, 0xd2, 0x43, 0x78, 0xc2, 0x32, 0x1f, 0x60,
+ 0xa9, 0x8a, 0x7f, 0x0f, 0x7c, 0xa6, 0x1d, 0xe6,
+ 0x92, 0x9e, 0x52, 0xc7, 0x7d, 0xbb, 0x35, 0x3b,
+ 0xaa, 0x89, 0x73, 0x4c, 0xfb, 0x99, 0x54, 0x97,
+ 0x99, 0x28, 0x6e, 0x66, 0x5b, 0xf7, 0x9b, 0x7e,
+ 0x6d, 0x8a, 0x2f, 0xfa, 0xc3, 0x1e, 0x71, 0xb9,
+ 0xbd, 0x8f, 0xc5, 0x63, 0x25, 0x31, 0x20, 0x02,
+ 0xff, 0x02, 0xf0, 0xc9, 0x2c, 0xdd, 0x3a, 0x10,
+ 0x30, 0xab, 0xe5, 0xad, 0x3d, 0x1a, 0x82, 0x77,
+ 0x46, 0xed, 0x03, 0x38, 0xa4, 0x73, 0x6d, 0x36,
+ 0x36, 0x33, 0x70, 0xb2, 0x63, 0x20, 0xca, 0x03,
+ 0xbf, 0x5a, 0xf4, 0x7c, 0x35, 0xf0, 0x63, 0x1a,
+ 0x12, 0x33, 0x12, 0x58, 0xd9, 0xa2, 0x63, 0x6b,
+ 0x63, 0x82, 0x41, 0x65, 0x70, 0x37, 0x4b, 0x99,
+ 0x04, 0x9f, 0xdd, 0x5e, 0x07, 0x01, 0x95, 0x9f,
+ 0x36, 0xe8, 0xc3, 0x66, 0x2a, 0x21, 0x69, 0x68,
+ 0x40, 0xe6, 0xbc, 0xbb, 0x85, 0x81, 0x21, 0x13,
+ 0xe6, 0xa4, 0xcf, 0xd3, 0x67, 0xe3, 0xfd, 0x75,
+ 0xf0, 0xdf, 0x83, 0xe0, 0xc5, 0x36, 0x09, 0xac,
+ 0x1b, 0xd4, 0xf7, 0x2a, 0x23, 0x57, 0x1c, 0x5c,
+ 0x0f, 0xf4, 0xcf, 0xa2, 0xcf, 0xf5, 0xbd, 0x9c,
+ 0x69, 0x98, 0x78, 0x3a, 0x25, 0xe4, 0xfd, 0x85,
+ 0x11, 0xcc, 0x7d, 0xef, 0xeb, 0x74, 0x60, 0xb1,
+ 0xb7, 0xfb, 0x1f, 0x0e, 0x62, 0xff, 0xfe, 0x09,
+ 0x0a, 0xc3, 0x80, 0x2f, 0x10, 0x49, 0x89, 0x78,
+ 0xd2, 0x08, 0xfa, 0x89, 0x22, 0x45, 0x91, 0x21,
+ 0xbc, 0x90, 0x3e, 0xad, 0xb3, 0x0a, 0xb4, 0x0e,
+ 0x1c, 0xa1, 0x93, 0x92, 0xd8, 0x72, 0x07, 0x54,
+ 0x60, 0xe7, 0x91, 0xfc, 0xd9, 0x3c, 0xe1, 0x6f,
+ 0x08, 0xe4, 0x56, 0xf6, 0x0b, 0xb0, 0x3c, 0x39,
+ 0x8a, 0x2d, 0x48, 0x44, 0x28, 0x13, 0xca, 0xe9,
+ 0xf7, 0xa3, 0xb6, 0x8a, 0x5f, 0x31, 0xa9, 0x72,
+ 0xf2, 0xde, 0x96, 0xf2, 0xb1, 0x53, 0xb1, 0x3e,
+ 0x24, 0x57, 0xfd, 0x18, 0x45, 0x1f, 0xc5, 0x33,
+ 0x1b, 0xa4, 0xe8, 0x21, 0xfa, 0x0e, 0xb2, 0xb9,
+ 0xcb, 0xc7, 0x07, 0x41, 0xdd, 0x2f, 0xb6, 0x6a,
+ 0x23, 0x18, 0xed, 0xc1, 0xef, 0xe2, 0x4b, 0xec,
+ 0xc9, 0xba, 0xfb, 0x46, 0x43, 0x90, 0xd7, 0xb5,
+ 0x68, 0x28, 0x31, 0x2b, 0x8d, 0xa8, 0x51, 0x63,
+ 0xf7, 0x53, 0x99, 0x19, 0x68, 0x85, 0x66, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x05, 0x58, 0x2e, 0x35,
+ 0x30, 0x39, 0x00, 0x00, 0x02, 0x3a, 0x30, 0x82,
+ 0x02, 0x36, 0x30, 0x82, 0x01, 0xe0, 0xa0, 0x03,
+ 0x02, 0x01, 0x02, 0x02, 0x04, 0x48, 0x59, 0xf1,
+ 0x92, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
+ 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00,
+ 0x30, 0x81, 0xa0, 0x31, 0x0b, 0x30, 0x09, 0x06,
+ 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4b, 0x52,
+ 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04,
+ 0x08, 0x13, 0x0a, 0x4b, 0x79, 0x75, 0x6e, 0x67,
+ 0x67, 0x69, 0x2d, 0x64, 0x6f, 0x31, 0x14, 0x30,
+ 0x12, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13, 0x0b,
+ 0x53, 0x65, 0x6f, 0x6e, 0x67, 0x6e, 0x61, 0x6d,
+ 0x2d, 0x73, 0x69, 0x31, 0x1a, 0x30, 0x18, 0x06,
+ 0x03, 0x55, 0x04, 0x0a, 0x13, 0x11, 0x54, 0x68,
+ 0x65, 0x20, 0x4e, 0x65, 0x74, 0x74, 0x79, 0x20,
+ 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x31,
+ 0x18, 0x30, 0x16, 0x06, 0x03, 0x55, 0x04, 0x0b,
+ 0x13, 0x0f, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
+ 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72,
+ 0x73, 0x31, 0x30, 0x30, 0x2e, 0x06, 0x03, 0x55,
+ 0x04, 0x03, 0x13, 0x27, 0x73, 0x65, 0x63, 0x75,
+ 0x72, 0x65, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x65,
+ 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6e,
+ 0x65, 0x74, 0x74, 0x79, 0x2e, 0x67, 0x6c, 0x65,
+ 0x61, 0x6d, 0x79, 0x6e, 0x6f, 0x64, 0x65, 0x2e,
+ 0x6e, 0x65, 0x74, 0x30, 0x20, 0x17, 0x0d, 0x30,
+ 0x38, 0x30, 0x36, 0x31, 0x39, 0x30, 0x35, 0x34,
+ 0x31, 0x33, 0x38, 0x5a, 0x18, 0x0f, 0x32, 0x31,
+ 0x38, 0x37, 0x31, 0x31, 0x32, 0x34, 0x30, 0x35,
+ 0x34, 0x31, 0x33, 0x38, 0x5a, 0x30, 0x81, 0xa0,
+ 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04,
+ 0x06, 0x13, 0x02, 0x4b, 0x52, 0x31, 0x13, 0x30,
+ 0x11, 0x06, 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a,
+ 0x4b, 0x79, 0x75, 0x6e, 0x67, 0x67, 0x69, 0x2d,
+ 0x64, 0x6f, 0x31, 0x14, 0x30, 0x12, 0x06, 0x03,
+ 0x55, 0x04, 0x07, 0x13, 0x0b, 0x53, 0x65, 0x6f,
+ 0x6e, 0x67, 0x6e, 0x61, 0x6d, 0x2d, 0x73, 0x69,
+ 0x31, 0x1a, 0x30, 0x18, 0x06, 0x03, 0x55, 0x04,
+ 0x0a, 0x13, 0x11, 0x54, 0x68, 0x65, 0x20, 0x4e,
+ 0x65, 0x74, 0x74, 0x79, 0x20, 0x50, 0x72, 0x6f,
+ 0x6a, 0x65, 0x63, 0x74, 0x31, 0x18, 0x30, 0x16,
+ 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x0f, 0x45,
+ 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x41,
+ 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x31, 0x30,
+ 0x30, 0x2e, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
+ 0x27, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x63,
+ 0x68, 0x61, 0x74, 0x2e, 0x65, 0x78, 0x61, 0x6d,
+ 0x70, 0x6c, 0x65, 0x2e, 0x6e, 0x65, 0x74, 0x74,
+ 0x79, 0x2e, 0x67, 0x6c, 0x65, 0x61, 0x6d, 0x79,
+ 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6e, 0x65, 0x74,
+ 0x30, 0x5c, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
+ 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05,
+ 0x00, 0x03, 0x4b, 0x00, 0x30, 0x48, 0x02, 0x41,
+ 0x00, 0xc3, 0xe3, 0x5e, 0x41, 0xa7, 0x87, 0x11,
+ 0x00, 0x42, 0x2a, 0xb0, 0x4b, 0xed, 0xb2, 0xe0,
+ 0x23, 0xdb, 0xb1, 0x3d, 0x58, 0x97, 0x35, 0x60,
+ 0x0b, 0x82, 0x59, 0xd3, 0x00, 0xea, 0xd4, 0x61,
+ 0xb8, 0x79, 0x3f, 0xb6, 0x3c, 0x12, 0x05, 0x93,
+ 0x2e, 0x9a, 0x59, 0x68, 0x14, 0x77, 0x3a, 0xc8,
+ 0x50, 0x25, 0x57, 0xa4, 0x49, 0x18, 0x63, 0x41,
+ 0xf0, 0x2d, 0x28, 0xec, 0x06, 0xfb, 0xb4, 0x9f,
+ 0xbf, 0x02, 0x03, 0x01, 0x00, 0x01, 0x30, 0x0d,
+ 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d,
+ 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x41, 0x00,
+ 0x65, 0x6c, 0x30, 0x01, 0xc2, 0x8e, 0x3e, 0xcb,
+ 0xb3, 0x77, 0x48, 0xe9, 0x66, 0x61, 0x9a, 0x40,
+ 0x86, 0xaf, 0xf6, 0x03, 0xeb, 0xba, 0x6a, 0xf2,
+ 0xfd, 0xe2, 0xaf, 0x36, 0x5e, 0x7b, 0xaa, 0x22,
+ 0x04, 0xdd, 0x2c, 0x20, 0xc4, 0xfc, 0xdd, 0xd0,
+ 0x82, 0x20, 0x1c, 0x3d, 0xd7, 0x9e, 0x5e, 0x5c,
+ 0x92, 0x5a, 0x76, 0x71, 0x28, 0xf5, 0x07, 0x7d,
+ 0xa2, 0x81, 0xba, 0x77, 0x9f, 0x2a, 0xd9, 0x44,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x6d, 0x79,
+ 0x6b, 0x65, 0x79, 0x00, 0x00, 0x01, 0x1a, 0x9f,
+ 0x5b, 0x56, 0xa0, 0x00, 0x00, 0x01, 0x99, 0x30,
+ 0x82, 0x01, 0x95, 0x30, 0x0e, 0x06, 0x0a, 0x2b,
+ 0x06, 0x01, 0x04, 0x01, 0x2a, 0x02, 0x11, 0x01,
+ 0x01, 0x05, 0x00, 0x04, 0x82, 0x01, 0x81, 0x29,
+ 0xa8, 0xb6, 0x08, 0x0c, 0x85, 0x75, 0x3e, 0xdd,
+ 0xb5, 0xe5, 0x1a, 0x87, 0x68, 0xd1, 0x90, 0x4b,
+ 0x29, 0x31, 0xee, 0x90, 0xbc, 0x9d, 0x73, 0xa0,
+ 0x3f, 0xe9, 0x0b, 0xa4, 0xef, 0x30, 0x9b, 0x36,
+ 0x9a, 0xb2, 0x54, 0x77, 0x81, 0x07, 0x4b, 0xaa,
+ 0xa5, 0x77, 0x98, 0xe1, 0xeb, 0xb5, 0x7c, 0x4e,
+ 0x48, 0xd5, 0x08, 0xfc, 0x2c, 0x36, 0xe2, 0x65,
+ 0x03, 0xac, 0xe5, 0xf3, 0x96, 0xb7, 0xd0, 0xb5,
+ 0x3b, 0x92, 0xe4, 0x14, 0x05, 0x7a, 0x6a, 0x92,
+ 0x56, 0xfe, 0x4e, 0xab, 0xd3, 0x0e, 0x32, 0x04,
+ 0x22, 0x22, 0x74, 0x47, 0x7d, 0xec, 0x21, 0x99,
+ 0x30, 0x31, 0x64, 0x46, 0x64, 0x9b, 0xc7, 0x13,
+ 0xbf, 0xbe, 0xd0, 0x31, 0x49, 0xe7, 0x3c, 0xbf,
+ 0xba, 0xb1, 0x20, 0xf9, 0x42, 0xf4, 0xa9, 0xa9,
+ 0xe5, 0x13, 0x65, 0x32, 0xbf, 0x7c, 0xcc, 0x91,
+ 0xd3, 0xfd, 0x24, 0x47, 0x0b, 0xe5, 0x53, 0xad,
+ 0x50, 0x30, 0x56, 0xd1, 0xfa, 0x9c, 0x37, 0xa8,
+ 0xc1, 0xce, 0xf6, 0x0b, 0x18, 0xaa, 0x7c, 0xab,
+ 0xbd, 0x1f, 0xdf, 0xe4, 0x80, 0xb8, 0xa7, 0xe0,
+ 0xad, 0x7d, 0x50, 0x74, 0xf1, 0x98, 0x78, 0xbc,
+ 0x58, 0xb9, 0xc2, 0x52, 0xbe, 0xd2, 0x5b, 0x81,
+ 0x94, 0x83, 0x8f, 0xb9, 0x4c, 0xee, 0x01, 0x2b,
+ 0x5e, 0xc9, 0x6e, 0x9b, 0xf5, 0x63, 0x69, 0xe4,
+ 0xd8, 0x0b, 0x47, 0xd8, 0xfd, 0xd8, 0xe0, 0xed,
+ 0xa8, 0x27, 0x03, 0x74, 0x1e, 0x5d, 0x32, 0xe6,
+ 0x5c, 0x63, 0xc2, 0xfb, 0x3f, 0xee, 0xb4, 0x13,
+ 0xc6, 0x0e, 0x6e, 0x74, 0xe0, 0x22, 0xac, 0xce,
+ 0x79, 0xf9, 0x43, 0x68, 0xc1, 0x03, 0x74, 0x2b,
+ 0xe1, 0x18, 0xf8, 0x7f, 0x76, 0x9a, 0xea, 0x82,
+ 0x3f, 0xc2, 0xa6, 0xa7, 0x4c, 0xfe, 0xae, 0x29,
+ 0x3b, 0xc1, 0x10, 0x7c, 0xd5, 0x77, 0x17, 0x79,
+ 0x5f, 0xcb, 0xad, 0x1f, 0xd8, 0xa1, 0xfd, 0x90,
+ 0xe1, 0x6b, 0xb2, 0xef, 0xb9, 0x41, 0x26, 0xa4,
+ 0x0b, 0x4f, 0xc6, 0x83, 0x05, 0x6f, 0xf0, 0x64,
+ 0x40, 0xe1, 0x44, 0xc4, 0xf9, 0x40, 0x2b, 0x3b,
+ 0x40, 0xdb, 0xaf, 0x35, 0xa4, 0x9b, 0x9f, 0xc4,
+ 0x74, 0x07, 0xe5, 0x18, 0x60, 0xc5, 0xfe, 0x15,
+ 0x0e, 0x3a, 0x25, 0x2a, 0x11, 0xee, 0x78, 0x2f,
+ 0xb8, 0xd1, 0x6e, 0x4e, 0x3c, 0x0a, 0xb5, 0xb9,
+ 0x40, 0x86, 0x27, 0x6d, 0x8f, 0x53, 0xb7, 0x77,
+ 0x36, 0xec, 0x5d, 0xed, 0x32, 0x40, 0x43, 0x82,
+ 0xc3, 0x52, 0x58, 0xc4, 0x26, 0x39, 0xf3, 0xb3,
+ 0xad, 0x58, 0xab, 0xb7, 0xf7, 0x8e, 0x0e, 0xba,
+ 0x8e, 0x78, 0x9d, 0xbf, 0x58, 0x34, 0xbd, 0x77,
+ 0x73, 0xa6, 0x50, 0x55, 0x00, 0x60, 0x26, 0xbf,
+ 0x6d, 0xb4, 0x98, 0x8a, 0x18, 0x83, 0x89, 0xf8,
+ 0xcd, 0x0d, 0x49, 0x06, 0xae, 0x51, 0x6e, 0xaf,
+ 0xbd, 0xe2, 0x07, 0x13, 0xd8, 0x64, 0xcc, 0xbf,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x58, 0x2e,
+ 0x35, 0x30, 0x39, 0x00, 0x00, 0x02, 0x34, 0x30,
+ 0x82, 0x02, 0x30, 0x30, 0x82, 0x01, 0xda, 0xa0,
+ 0x03, 0x02, 0x01, 0x02, 0x02, 0x04, 0x48, 0x59,
+ 0xf2, 0x84, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86,
+ 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05,
+ 0x00, 0x30, 0x81, 0x9d, 0x31, 0x0b, 0x30, 0x09,
+ 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x4b,
+ 0x52, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55,
+ 0x04, 0x08, 0x13, 0x0a, 0x4b, 0x79, 0x75, 0x6e,
+ 0x67, 0x67, 0x69, 0x2d, 0x64, 0x6f, 0x31, 0x14,
+ 0x30, 0x12, 0x06, 0x03, 0x55, 0x04, 0x07, 0x13,
+ 0x0b, 0x53, 0x65, 0x6f, 0x6e, 0x67, 0x6e, 0x61,
+ 0x6d, 0x2d, 0x73, 0x69, 0x31, 0x1a, 0x30, 0x18,
+ 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x11, 0x54,
+ 0x68, 0x65, 0x20, 0x4e, 0x65, 0x74, 0x74, 0x79,
+ 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04,
+ 0x0b, 0x13, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x72,
+ 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x31,
+ 0x30, 0x30, 0x2e, 0x06, 0x03, 0x55, 0x04, 0x03,
+ 0x13, 0x27, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65,
+ 0x63, 0x68, 0x61, 0x74, 0x2e, 0x65, 0x78, 0x61,
+ 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6e, 0x65, 0x74,
+ 0x74, 0x79, 0x2e, 0x67, 0x6c, 0x65, 0x61, 0x6d,
+ 0x79, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6e, 0x65,
+ 0x74, 0x30, 0x20, 0x17, 0x0d, 0x30, 0x38, 0x30,
+ 0x36, 0x31, 0x39, 0x30, 0x35, 0x34, 0x35, 0x34,
+ 0x30, 0x5a, 0x18, 0x0f, 0x32, 0x31, 0x38, 0x37,
+ 0x31, 0x31, 0x32, 0x33, 0x30, 0x35, 0x34, 0x35,
+ 0x34, 0x30, 0x5a, 0x30, 0x81, 0x9d, 0x31, 0x0b,
+ 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
+ 0x02, 0x4b, 0x52, 0x31, 0x13, 0x30, 0x11, 0x06,
+ 0x03, 0x55, 0x04, 0x08, 0x13, 0x0a, 0x4b, 0x79,
+ 0x75, 0x6e, 0x67, 0x67, 0x69, 0x2d, 0x64, 0x6f,
+ 0x31, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x04,
+ 0x07, 0x13, 0x0b, 0x53, 0x65, 0x6f, 0x6e, 0x67,
+ 0x6e, 0x61, 0x6d, 0x2d, 0x73, 0x69, 0x31, 0x1a,
+ 0x30, 0x18, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
+ 0x11, 0x54, 0x68, 0x65, 0x20, 0x4e, 0x65, 0x74,
+ 0x74, 0x79, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03,
+ 0x55, 0x04, 0x0b, 0x13, 0x0c, 0x43, 0x6f, 0x6e,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72,
+ 0x73, 0x31, 0x30, 0x30, 0x2e, 0x06, 0x03, 0x55,
+ 0x04, 0x03, 0x13, 0x27, 0x73, 0x65, 0x63, 0x75,
+ 0x72, 0x65, 0x63, 0x68, 0x61, 0x74, 0x2e, 0x65,
+ 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6e,
+ 0x65, 0x74, 0x74, 0x79, 0x2e, 0x67, 0x6c, 0x65,
+ 0x61, 0x6d, 0x79, 0x6e, 0x6f, 0x64, 0x65, 0x2e,
+ 0x6e, 0x65, 0x74, 0x30, 0x5c, 0x30, 0x0d, 0x06,
+ 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
+ 0x01, 0x01, 0x05, 0x00, 0x03, 0x4b, 0x00, 0x30,
+ 0x48, 0x02, 0x41, 0x00, 0x95, 0xb3, 0x47, 0x17,
+ 0x95, 0x0f, 0x57, 0xcf, 0x66, 0x72, 0x0a, 0x7e,
+ 0x5b, 0x54, 0xea, 0x8c, 0x6f, 0x79, 0xde, 0x94,
+ 0xac, 0x0b, 0x5a, 0xd4, 0xd6, 0x1b, 0x58, 0x12,
+ 0x1a, 0x16, 0x3d, 0xfe, 0xdf, 0xa5, 0x2b, 0x86,
+ 0xbc, 0x64, 0xd4, 0x80, 0x1e, 0x3f, 0xf9, 0xe2,
+ 0x04, 0x03, 0x79, 0x9b, 0xc1, 0x5c, 0xf0, 0xf1,
+ 0xf3, 0xf1, 0xe3, 0xbf, 0x3f, 0xc0, 0x1f, 0xdd,
+ 0xdb, 0xc0, 0x5b, 0x21, 0x02, 0x03, 0x01, 0x00,
+ 0x01, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48,
+ 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00,
+ 0x03, 0x41, 0x00, 0x02, 0xd7, 0xdd, 0xbd, 0x0c,
+ 0x8e, 0x21, 0x20, 0xef, 0x9e, 0x4f, 0x1f, 0xf5,
+ 0x49, 0xf1, 0xae, 0x58, 0x9b, 0x94, 0x3a, 0x1f,
+ 0x70, 0x33, 0xf0, 0x9b, 0xbb, 0xe9, 0xc0, 0xf3,
+ 0x72, 0xcb, 0xde, 0xb6, 0x56, 0x72, 0xcc, 0x1c,
+ 0xf0, 0xd6, 0x5a, 0x2a, 0xbc, 0xa1, 0x7e, 0x23,
+ 0x83, 0xe9, 0xe7, 0xcf, 0x9e, 0xa5, 0xf9, 0xcc,
+ 0xc2, 0x61, 0xf4, 0xdb, 0x40, 0x93, 0x1d, 0x63,
+ 0x8a, 0x50, 0x4c, 0x11, 0x39, 0xb1, 0x91, 0xc1,
+ 0xe6, 0x9d, 0xd9, 0x1a, 0x62, 0x1b, 0xb8, 0xd3,
+ 0xd6, 0x9a, 0x6d, 0xb9, 0x8e, 0x15, 0x51 };
+
+ public static InputStream asInputStream() {
+ byte[] data = new byte[DATA.length];
+ for (int i = 0; i < data.length; i ++) {
+ data[i] = (byte) DATA[i];
+ }
+ return new ByteArrayInputStream(data);
+ }
+
+ public static char[] getCertificatePassword() {
+ return "secret".toCharArray();
+ }
+
+ public static char[] getKeyStorePassword() {
+ return "secret".toCharArray();
+ }
+
+ private BogusKeyStore() {
+ // Unused
+ }
+ }
+}
diff --git a/src/test/java/io/netty/handler/codec/string/AbstractSocketStringEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketStringEchoTest.java
similarity index 95%
rename from src/test/java/io/netty/handler/codec/string/AbstractSocketStringEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketStringEchoTest.java
index c8be69048f..4c49379aa3 100644
--- a/src/test/java/io/netty/handler/codec/string/AbstractSocketStringEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractSocketStringEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.string;
+package io.netty.testsuite.transport.socket;
import static org.junit.Assert.*;
@@ -37,8 +37,10 @@ import io.netty.channel.MessageEvent;
import io.netty.channel.SimpleChannelUpstreamHandler;
import io.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
import io.netty.handler.codec.frame.Delimiters;
+import io.netty.handler.codec.string.StringDecoder;
+import io.netty.handler.codec.string.StringEncoder;
import io.netty.util.CharsetUtil;
-import io.netty.util.TestUtil;
+import io.netty.util.SocketAddresses;
import io.netty.util.internal.ExecutorUtil;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -100,7 +102,7 @@ public abstract class AbstractSocketStringEchoTest {
Channel sc = sb.bind(new InetSocketAddress(0));
int port = ((InetSocketAddress) sc.getLocalAddress()).getPort();
- ChannelFuture ccf = cb.connect(new InetSocketAddress(TestUtil.getLocalHost(), port));
+ ChannelFuture ccf = cb.connect(new InetSocketAddress(SocketAddresses.LOCALHOST, port));
assertTrue(ccf.awaitUninterruptibly().isSuccess());
Channel cc = ccf.getChannel();
diff --git a/src/test/java/io/netty/handler/codec/serialization/NioNioSocketCompatibleObjectStreamEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketCompatibleObjectStreamEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/serialization/NioNioSocketCompatibleObjectStreamEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketCompatibleObjectStreamEchoTest.java
index 9725515f8d..ddfa9ac798 100644
--- a/src/test/java/io/netty/handler/codec/serialization/NioNioSocketCompatibleObjectStreamEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketCompatibleObjectStreamEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.serialization;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/frame/NioNioSocketFixedLengthEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketFixedLengthEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/frame/NioNioSocketFixedLengthEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketFixedLengthEchoTest.java
index e9c41f03e3..ab6c35d016 100644
--- a/src/test/java/io/netty/handler/codec/frame/NioNioSocketFixedLengthEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketFixedLengthEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.frame;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/serialization/NioNioSocketObjectStreamEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketObjectStreamEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/serialization/NioNioSocketObjectStreamEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketObjectStreamEchoTest.java
index 596d59bc41..37dd041aac 100644
--- a/src/test/java/io/netty/handler/codec/serialization/NioNioSocketObjectStreamEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketObjectStreamEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.serialization;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/string/NioNioSocketStringEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketStringEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/string/NioNioSocketStringEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketStringEchoTest.java
index 492567e22f..3ffcaaf9ff 100644
--- a/src/test/java/io/netty/handler/codec/string/NioNioSocketStringEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioNioSocketStringEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.string;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/serialization/NioOioSocketCompatibleObjectStreamEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketCompatibleObjectStreamEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/serialization/NioOioSocketCompatibleObjectStreamEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketCompatibleObjectStreamEchoTest.java
index b18110b3e1..5fa5ea84af 100644
--- a/src/test/java/io/netty/handler/codec/serialization/NioOioSocketCompatibleObjectStreamEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketCompatibleObjectStreamEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.serialization;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/frame/NioOioSocketFixedLengthEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketFixedLengthEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/frame/NioOioSocketFixedLengthEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketFixedLengthEchoTest.java
index c5a0260bc5..5606117fc0 100644
--- a/src/test/java/io/netty/handler/codec/frame/NioOioSocketFixedLengthEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketFixedLengthEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.frame;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/serialization/NioOioSocketObjectStreamEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketObjectStreamEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/serialization/NioOioSocketObjectStreamEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketObjectStreamEchoTest.java
index e693a10568..376cebc1c2 100644
--- a/src/test/java/io/netty/handler/codec/serialization/NioOioSocketObjectStreamEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketObjectStreamEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.serialization;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/string/NioOioSocketStringEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketStringEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/string/NioOioSocketStringEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketStringEchoTest.java
index 763e9956f4..de39c167d3 100644
--- a/src/test/java/io/netty/handler/codec/string/NioOioSocketStringEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/NioOioSocketStringEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.string;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/serialization/OioNioSocketCompatibleObjectStreamEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketCompatibleObjectStreamEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/serialization/OioNioSocketCompatibleObjectStreamEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketCompatibleObjectStreamEchoTest.java
index 8d7e232aa5..1705d25be2 100644
--- a/src/test/java/io/netty/handler/codec/serialization/OioNioSocketCompatibleObjectStreamEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketCompatibleObjectStreamEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.serialization;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/frame/OioNioSocketFixedLengthEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketFixedLengthEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/frame/OioNioSocketFixedLengthEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketFixedLengthEchoTest.java
index 8dfee2731b..59f0930143 100644
--- a/src/test/java/io/netty/handler/codec/frame/OioNioSocketFixedLengthEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketFixedLengthEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.frame;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/serialization/OioNioSocketObjectStreamEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketObjectStreamEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/serialization/OioNioSocketObjectStreamEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketObjectStreamEchoTest.java
index c877cf3b6f..9e8689e406 100644
--- a/src/test/java/io/netty/handler/codec/serialization/OioNioSocketObjectStreamEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketObjectStreamEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.serialization;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/string/OioNioSocketStringEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketStringEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/string/OioNioSocketStringEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketStringEchoTest.java
index a593dc7022..dab455dac5 100644
--- a/src/test/java/io/netty/handler/codec/string/OioNioSocketStringEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioNioSocketStringEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.string;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/serialization/OioOioSocketCompatibleObjectStreamEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketCompatibleObjectStreamEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/serialization/OioOioSocketCompatibleObjectStreamEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketCompatibleObjectStreamEchoTest.java
index 98c47ab2ed..f9c04c8be8 100644
--- a/src/test/java/io/netty/handler/codec/serialization/OioOioSocketCompatibleObjectStreamEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketCompatibleObjectStreamEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.serialization;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/frame/OioOioSocketFixedLengthEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketFixedLengthEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/frame/OioOioSocketFixedLengthEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketFixedLengthEchoTest.java
index 77ba5de155..603bf4c3e4 100644
--- a/src/test/java/io/netty/handler/codec/frame/OioOioSocketFixedLengthEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketFixedLengthEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.frame;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/serialization/OioOioSocketObjectStreamEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketObjectStreamEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/serialization/OioOioSocketObjectStreamEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketObjectStreamEchoTest.java
index d3149e04d6..ea3c1d38dd 100644
--- a/src/test/java/io/netty/handler/codec/serialization/OioOioSocketObjectStreamEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketObjectStreamEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.serialization;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/handler/codec/string/OioOioSocketStringEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketStringEchoTest.java
similarity index 96%
rename from src/test/java/io/netty/handler/codec/string/OioOioSocketStringEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketStringEchoTest.java
index 74f5164302..20b547b8fa 100644
--- a/src/test/java/io/netty/handler/codec/string/OioOioSocketStringEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/OioOioSocketStringEchoTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.codec.string;
+package io.netty.testsuite.transport.socket;
import java.util.concurrent.Executor;
diff --git a/src/test/java/io/netty/channel/socket/NioClientSocketShutdownTimeTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioClientSocketShutdownTimeTest.java
similarity index 93%
rename from src/test/java/io/netty/channel/socket/NioClientSocketShutdownTimeTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioClientSocketShutdownTimeTest.java
index 51ffc8236a..7d488ddebc 100644
--- a/src/test/java/io/netty/channel/socket/NioClientSocketShutdownTimeTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioClientSocketShutdownTimeTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket;
+package io.netty.testsuite.transport.socket.nio;
import static org.junit.Assert.*;
@@ -22,13 +22,13 @@ import java.net.InetSocketAddress;
import java.nio.channels.ServerSocketChannel;
import java.util.concurrent.Executors;
+import org.junit.Test;
+
import io.netty.bootstrap.ClientBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.socket.nio.NioClientSocketChannelFactory;
-import io.netty.util.DummyHandler;
-import io.netty.util.TestUtil;
-import org.junit.Test;
-
+import io.netty.testsuite.util.DummyHandler;
+import io.netty.util.SocketAddresses;
/**
*/
@@ -52,7 +52,7 @@ public class NioClientSocketShutdownTimeTest {
serverSocket.configureBlocking(false);
ChannelFuture f = b.connect(new InetSocketAddress(
- TestUtil.getLocalHost(),
+ SocketAddresses.LOCALHOST,
serverSocket.socket().getLocalPort()));
serverSocket.accept();
diff --git a/src/test/java/io/netty/channel/socket/NioServerSocketShutdownTimeTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioServerSocketShutdownTimeTest.java
similarity index 96%
rename from src/test/java/io/netty/channel/socket/NioServerSocketShutdownTimeTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioServerSocketShutdownTimeTest.java
index 534fc0cb68..2c063ee6ae 100644
--- a/src/test/java/io/netty/channel/socket/NioServerSocketShutdownTimeTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioServerSocketShutdownTimeTest.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket;
+package io.netty.testsuite.transport.socket.nio;
import static org.junit.Assert.*;
@@ -28,7 +28,7 @@ import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelStateEvent;
import io.netty.channel.SimpleChannelUpstreamHandler;
import io.netty.channel.socket.nio.NioServerSocketChannelFactory;
-import io.netty.util.TestUtil;
+import io.netty.util.SocketAddresses;
import org.junit.Test;
@@ -57,7 +57,7 @@ public class NioServerSocketShutdownTimeTest {
Socket socket = null;
try {
socket = new Socket(
- TestUtil.getLocalHost(),
+ SocketAddresses.LOCALHOST,
((InetSocketAddress) channel.getLocalAddress()).getPort());
while (!handler.connected) {
diff --git a/src/test/java/io/netty/bootstrap/NioSocketClientBootstrapTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioSocketClientBootstrapTest.java
similarity index 90%
rename from src/test/java/io/netty/bootstrap/NioSocketClientBootstrapTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioSocketClientBootstrapTest.java
index a1a77dfd3d..56b80ad5ab 100644
--- a/src/test/java/io/netty/bootstrap/NioSocketClientBootstrapTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioSocketClientBootstrapTest.java
@@ -13,12 +13,13 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.bootstrap;
+package io.netty.testsuite.transport.socket.nio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.nio.NioClientSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketClientBootstrapTest;
/**
* A test for New I/O socket client bootstraps
diff --git a/src/test/java/io/netty/bootstrap/NioSocketServerBootstrapTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioSocketServerBootstrapTest.java
similarity index 90%
rename from src/test/java/io/netty/bootstrap/NioSocketServerBootstrapTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioSocketServerBootstrapTest.java
index f2e63968ff..7347ecdd5c 100644
--- a/src/test/java/io/netty/bootstrap/NioSocketServerBootstrapTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/NioSocketServerBootstrapTest.java
@@ -13,12 +13,13 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.bootstrap;
+package io.netty.testsuite.transport.socket.nio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.nio.NioServerSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketServerBootstrapTest;
/**
* A test for New I/O socket server bootstraps
diff --git a/src/test/java/io/netty/channel/socket/nio/UdpClient.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/UdpClient.java
similarity index 95%
rename from src/test/java/io/netty/channel/socket/nio/UdpClient.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/UdpClient.java
index d891b20626..09c7847ce2 100644
--- a/src/test/java/io/netty/channel/socket/nio/UdpClient.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/UdpClient.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.nio;
+package io.netty.testsuite.transport.socket.nio;
import java.io.IOException;
import java.net.DatagramPacket;
@@ -65,11 +65,10 @@ public class UdpClient {
* @param payload The payload of bytes to send
* @return The datagram packet sent
*/
- public DatagramPacket send(final byte[] payload) throws IOException {
+ public void send(final byte[] payload) throws IOException {
final DatagramPacket dp =
new DatagramPacket(payload, payload.length, address, port);
clientSocket.send(dp);
- return dp;
}
/**
diff --git a/src/test/java/io/netty/channel/socket/NioNioSocketEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/nio/NioNioSocketEchoTest.java
similarity index 91%
rename from src/test/java/io/netty/channel/socket/NioNioSocketEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/nio/NioNioSocketEchoTest.java
index 44c234ae58..b2c1687832 100644
--- a/src/test/java/io/netty/channel/socket/NioNioSocketEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/nio/NioNioSocketEchoTest.java
@@ -13,13 +13,14 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket;
+package io.netty.testsuite.transport.socket.nio.nio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.nio.NioClientSocketChannelFactory;
import io.netty.channel.socket.nio.NioServerSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketEchoTest;
/**
*/
diff --git a/src/test/java/io/netty/handler/ssl/NioNioSocketSslEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/nio/NioNioSocketSslEchoTest.java
similarity index 91%
rename from src/test/java/io/netty/handler/ssl/NioNioSocketSslEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/nio/NioNioSocketSslEchoTest.java
index bc1fca4c8e..93bf5fddd7 100644
--- a/src/test/java/io/netty/handler/ssl/NioNioSocketSslEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/nio/NioNioSocketSslEchoTest.java
@@ -13,13 +13,14 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.ssl;
+package io.netty.testsuite.transport.socket.nio.nio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.nio.NioClientSocketChannelFactory;
import io.netty.channel.socket.nio.NioServerSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketSslEchoTest;
/**
*/
diff --git a/src/test/java/io/netty/channel/socket/NioOioSocketEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/oio/NioOioSocketEchoTest.java
similarity index 91%
rename from src/test/java/io/netty/channel/socket/NioOioSocketEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/oio/NioOioSocketEchoTest.java
index 10c3fee546..4a3c80141f 100644
--- a/src/test/java/io/netty/channel/socket/NioOioSocketEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/oio/NioOioSocketEchoTest.java
@@ -13,13 +13,14 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket;
+package io.netty.testsuite.transport.socket.nio.oio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.nio.NioClientSocketChannelFactory;
import io.netty.channel.socket.oio.OioServerSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketEchoTest;
/**
*/
diff --git a/src/test/java/io/netty/handler/ssl/NioOioSocketSslEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/oio/NioOioSocketSslEchoTest.java
similarity index 91%
rename from src/test/java/io/netty/handler/ssl/NioOioSocketSslEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/oio/NioOioSocketSslEchoTest.java
index 6a9b9b2e10..cfe662e544 100644
--- a/src/test/java/io/netty/handler/ssl/NioOioSocketSslEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/nio/oio/NioOioSocketSslEchoTest.java
@@ -13,13 +13,14 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.ssl;
+package io.netty.testsuite.transport.socket.nio.oio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.nio.NioClientSocketChannelFactory;
import io.netty.channel.socket.oio.OioServerSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketSslEchoTest;
/**
*/
diff --git a/src/test/java/io/netty/bootstrap/OioSocketClientBootstrapTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/OioSocketClientBootstrapTest.java
similarity index 90%
rename from src/test/java/io/netty/bootstrap/OioSocketClientBootstrapTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/OioSocketClientBootstrapTest.java
index c6d864eacd..dc965f9b69 100644
--- a/src/test/java/io/netty/bootstrap/OioSocketClientBootstrapTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/OioSocketClientBootstrapTest.java
@@ -13,12 +13,13 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.bootstrap;
+package io.netty.testsuite.transport.socket.oio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.oio.OioClientSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketClientBootstrapTest;
/**
* A test for "Old" I/O socket client bootstraps
diff --git a/src/test/java/io/netty/bootstrap/OioSocketServerBootstrapTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/OioSocketServerBootstrapTest.java
similarity index 90%
rename from src/test/java/io/netty/bootstrap/OioSocketServerBootstrapTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/OioSocketServerBootstrapTest.java
index afd75d66b1..47da2f6660 100644
--- a/src/test/java/io/netty/bootstrap/OioSocketServerBootstrapTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/OioSocketServerBootstrapTest.java
@@ -13,12 +13,13 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.bootstrap;
+package io.netty.testsuite.transport.socket.oio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.oio.OioServerSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketServerBootstrapTest;
/**
* A socket server bootstrap test for "Old" I/O
diff --git a/src/test/java/io/netty/channel/socket/OioNioSocketEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/nio/OioNioSocketEchoTest.java
similarity index 91%
rename from src/test/java/io/netty/channel/socket/OioNioSocketEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/nio/OioNioSocketEchoTest.java
index b9e25256f9..c78028496c 100644
--- a/src/test/java/io/netty/channel/socket/OioNioSocketEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/nio/OioNioSocketEchoTest.java
@@ -13,13 +13,14 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket;
+package io.netty.testsuite.transport.socket.oio.nio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.nio.NioServerSocketChannelFactory;
import io.netty.channel.socket.oio.OioClientSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketEchoTest;
/**
*/
diff --git a/src/test/java/io/netty/handler/ssl/OioNioSocketSslEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/nio/OioNioSocketSslEchoTest.java
similarity index 91%
rename from src/test/java/io/netty/handler/ssl/OioNioSocketSslEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/nio/OioNioSocketSslEchoTest.java
index 52a3abc3e5..d14effe29a 100644
--- a/src/test/java/io/netty/handler/ssl/OioNioSocketSslEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/nio/OioNioSocketSslEchoTest.java
@@ -13,13 +13,14 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.ssl;
+package io.netty.testsuite.transport.socket.oio.nio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.nio.NioServerSocketChannelFactory;
import io.netty.channel.socket.oio.OioClientSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketSslEchoTest;
/**
*/
diff --git a/src/test/java/io/netty/channel/socket/OioOioSocketEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/oio/OioOioSocketEchoTest.java
similarity index 91%
rename from src/test/java/io/netty/channel/socket/OioOioSocketEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/oio/OioOioSocketEchoTest.java
index c7d1a33e08..19c543a4e6 100644
--- a/src/test/java/io/netty/channel/socket/OioOioSocketEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/oio/OioOioSocketEchoTest.java
@@ -13,13 +13,14 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket;
+package io.netty.testsuite.transport.socket.oio.oio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.oio.OioClientSocketChannelFactory;
import io.netty.channel.socket.oio.OioServerSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketEchoTest;
/**
*/
diff --git a/src/test/java/io/netty/handler/ssl/OioOioSocketSslEchoTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/oio/OioOioSocketSslEchoTest.java
similarity index 91%
rename from src/test/java/io/netty/handler/ssl/OioOioSocketSslEchoTest.java
rename to testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/oio/OioOioSocketSslEchoTest.java
index 97a26491c5..65b7dec947 100644
--- a/src/test/java/io/netty/handler/ssl/OioOioSocketSslEchoTest.java
+++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/oio/oio/OioOioSocketSslEchoTest.java
@@ -13,13 +13,14 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.handler.ssl;
+package io.netty.testsuite.transport.socket.oio.oio;
import java.util.concurrent.Executor;
import io.netty.channel.ChannelFactory;
import io.netty.channel.socket.oio.OioClientSocketChannelFactory;
import io.netty.channel.socket.oio.OioServerSocketChannelFactory;
+import io.netty.testsuite.transport.socket.AbstractSocketSslEchoTest;
/**
*/
diff --git a/src/test/java/io/netty/util/DummyHandler.java b/testsuite/src/test/java/io/netty/testsuite/util/DummyHandler.java
similarity index 92%
rename from src/test/java/io/netty/util/DummyHandler.java
rename to testsuite/src/test/java/io/netty/testsuite/util/DummyHandler.java
index ed2e7ed815..5ec679a904 100644
--- a/src/test/java/io/netty/util/DummyHandler.java
+++ b/testsuite/src/test/java/io/netty/testsuite/util/DummyHandler.java
@@ -13,25 +13,20 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.util;
+package io.netty.testsuite.util;
import io.netty.channel.ChannelDownstreamHandler;
import io.netty.channel.ChannelEvent;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelUpstreamHandler;
-/**
- * A dummy handler for a testing purpose.
- */
public class DummyHandler implements ChannelUpstreamHandler, ChannelDownstreamHandler {
- @Override
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e)
throws Exception {
ctx.sendUpstream(e);
}
- @Override
public void handleDownstream(ChannelHandlerContext ctx, ChannelEvent e)
throws Exception {
ctx.sendDownstream(e);
diff --git a/transport-http/pom.xml b/transport-http/pom.xml
new file mode 100644
index 0000000000..258604e89d
--- /dev/null
+++ b/transport-http/pom.xml
@@ -0,0 +1,40 @@
+
+
+
+
+ 4.0.0
+
+ io.netty
+ netty-parent
+ 4.0.0.Alpha1-SNAPSHOT
+
+
+ io.netty
+ netty-transport-http
+ jar
+
+ Netty/Transport/HTTP
+
+
+
+ ${project.groupId}
+ netty-codec-http
+ ${project.version}
+
+
+
+
diff --git a/src/main/java/io/netty/channel/socket/http/AcceptedServerChannelPipelineFactory.java b/transport-http/src/main/java/io/netty/channel/socket/http/AcceptedServerChannelPipelineFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/AcceptedServerChannelPipelineFactory.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/AcceptedServerChannelPipelineFactory.java
diff --git a/src/main/java/io/netty/channel/socket/http/AcceptedServerChannelRequestDispatch.java b/transport-http/src/main/java/io/netty/channel/socket/http/AcceptedServerChannelRequestDispatch.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/AcceptedServerChannelRequestDispatch.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/AcceptedServerChannelRequestDispatch.java
diff --git a/src/main/java/io/netty/channel/socket/http/DefaultTunnelIdGenerator.java b/transport-http/src/main/java/io/netty/channel/socket/http/DefaultTunnelIdGenerator.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/DefaultTunnelIdGenerator.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/DefaultTunnelIdGenerator.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannel.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannel.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannel.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelConfig.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelConfig.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelFactory.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelFactory.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelReceiver.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelReceiver.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelReceiver.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelReceiver.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelSink.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelSink.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelSink.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelChannelConfig.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelChannelConfig.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannel.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannel.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannel.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelConfig.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelConfig.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelFactory.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelFactory.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelSink.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelSink.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientChannelSink.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelClientPollHandler.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientPollHandler.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelClientPollHandler.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientPollHandler.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelClientSendHandler.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientSendHandler.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelClientSendHandler.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientSendHandler.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelClientWorkerOwner.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientWorkerOwner.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelClientWorkerOwner.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelClientWorkerOwner.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelMessageUtils.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelMessageUtils.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelMessageUtils.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelMessageUtils.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannel.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannel.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannel.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelConfig.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelConfig.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelFactory.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelFactory.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelSink.java b/transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelSink.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/HttpTunnelServerChannelSink.java
diff --git a/src/main/java/io/netty/channel/socket/http/SaturationManager.java b/transport-http/src/main/java/io/netty/channel/socket/http/SaturationManager.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/SaturationManager.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/SaturationManager.java
diff --git a/src/main/java/io/netty/channel/socket/http/SaturationStateChange.java b/transport-http/src/main/java/io/netty/channel/socket/http/SaturationStateChange.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/SaturationStateChange.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/SaturationStateChange.java
diff --git a/src/main/java/io/netty/channel/socket/http/ServerMessageSwitch.java b/transport-http/src/main/java/io/netty/channel/socket/http/ServerMessageSwitch.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/ServerMessageSwitch.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/ServerMessageSwitch.java
diff --git a/src/main/java/io/netty/channel/socket/http/ServerMessageSwitchDownstreamInterface.java b/transport-http/src/main/java/io/netty/channel/socket/http/ServerMessageSwitchDownstreamInterface.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/ServerMessageSwitchDownstreamInterface.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/ServerMessageSwitchDownstreamInterface.java
diff --git a/src/main/java/io/netty/channel/socket/http/ServerMessageSwitchUpstreamInterface.java b/transport-http/src/main/java/io/netty/channel/socket/http/ServerMessageSwitchUpstreamInterface.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/ServerMessageSwitchUpstreamInterface.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/ServerMessageSwitchUpstreamInterface.java
diff --git a/src/main/java/io/netty/channel/socket/http/TunnelIdGenerator.java b/transport-http/src/main/java/io/netty/channel/socket/http/TunnelIdGenerator.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/TunnelIdGenerator.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/TunnelIdGenerator.java
diff --git a/src/main/java/io/netty/channel/socket/http/TunnelWrappedServerChannelHandler.java b/transport-http/src/main/java/io/netty/channel/socket/http/TunnelWrappedServerChannelHandler.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/TunnelWrappedServerChannelHandler.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/TunnelWrappedServerChannelHandler.java
diff --git a/src/main/java/io/netty/channel/socket/http/WriteFragmenter.java b/transport-http/src/main/java/io/netty/channel/socket/http/WriteFragmenter.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/WriteFragmenter.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/WriteFragmenter.java
diff --git a/src/main/java/io/netty/channel/socket/http/WriteSplitter.java b/transport-http/src/main/java/io/netty/channel/socket/http/WriteSplitter.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/WriteSplitter.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/WriteSplitter.java
diff --git a/src/main/java/io/netty/channel/socket/http/package-info.java b/transport-http/src/main/java/io/netty/channel/socket/http/package-info.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/http/package-info.java
rename to transport-http/src/main/java/io/netty/channel/socket/http/package-info.java
diff --git a/src/test/java/io/netty/channel/socket/http/AcceptedServerChannelRequestDispatchTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/AcceptedServerChannelRequestDispatchTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/AcceptedServerChannelRequestDispatchTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/AcceptedServerChannelRequestDispatchTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/FakeChannelConfig.java b/transport-http/src/test/java/io/netty/channel/socket/http/FakeChannelConfig.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/FakeChannelConfig.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/FakeChannelConfig.java
diff --git a/src/test/java/io/netty/channel/socket/http/FakeChannelSink.java b/transport-http/src/test/java/io/netty/channel/socket/http/FakeChannelSink.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/FakeChannelSink.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/FakeChannelSink.java
diff --git a/src/test/java/io/netty/channel/socket/http/FakeClientSocketChannelFactory.java b/transport-http/src/test/java/io/netty/channel/socket/http/FakeClientSocketChannelFactory.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/FakeClientSocketChannelFactory.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/FakeClientSocketChannelFactory.java
diff --git a/src/test/java/io/netty/channel/socket/http/FakeServerSocketChannel.java b/transport-http/src/test/java/io/netty/channel/socket/http/FakeServerSocketChannel.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/FakeServerSocketChannel.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/FakeServerSocketChannel.java
diff --git a/src/test/java/io/netty/channel/socket/http/FakeServerSocketChannelConfig.java b/transport-http/src/test/java/io/netty/channel/socket/http/FakeServerSocketChannelConfig.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/FakeServerSocketChannelConfig.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/FakeServerSocketChannelConfig.java
diff --git a/src/test/java/io/netty/channel/socket/http/FakeServerSocketChannelFactory.java b/transport-http/src/test/java/io/netty/channel/socket/http/FakeServerSocketChannelFactory.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/FakeServerSocketChannelFactory.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/FakeServerSocketChannelFactory.java
diff --git a/src/test/java/io/netty/channel/socket/http/FakeSocketChannel.java b/transport-http/src/test/java/io/netty/channel/socket/http/FakeSocketChannel.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/FakeSocketChannel.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/FakeSocketChannel.java
diff --git a/src/test/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelSinkTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelSinkTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelSinkTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelAcceptedChannelSinkTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/HttpTunnelClientChannelConfigTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelClientChannelConfigTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/HttpTunnelClientChannelConfigTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelClientChannelConfigTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/HttpTunnelClientChannelTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelClientChannelTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/HttpTunnelClientChannelTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelClientChannelTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/HttpTunnelClientPollHandlerTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelClientPollHandlerTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/HttpTunnelClientPollHandlerTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelClientPollHandlerTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/HttpTunnelClientSendHandlerTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelClientSendHandlerTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/HttpTunnelClientSendHandlerTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelClientSendHandlerTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelFactoryTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelFactoryTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelFactoryTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelFactoryTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelSinkTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelSinkTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelSinkTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelSinkTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelServerChannelTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/HttpTunnelSoakTester.java b/transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelSoakTester.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/HttpTunnelSoakTester.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelSoakTester.java
diff --git a/src/test/java/io/netty/channel/socket/http/HttpTunnelTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/HttpTunnelTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/HttpTunnelTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/MockChannelStateListener.java b/transport-http/src/test/java/io/netty/channel/socket/http/MockChannelStateListener.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/MockChannelStateListener.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/MockChannelStateListener.java
diff --git a/src/test/java/io/netty/channel/socket/http/NettyTestUtils.java b/transport-http/src/test/java/io/netty/channel/socket/http/NettyTestUtils.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/NettyTestUtils.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/NettyTestUtils.java
diff --git a/src/test/java/io/netty/channel/socket/http/NettyTestUtilsTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/NettyTestUtilsTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/NettyTestUtilsTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/NettyTestUtilsTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/NullChannelHandler.java b/transport-http/src/test/java/io/netty/channel/socket/http/NullChannelHandler.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/NullChannelHandler.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/NullChannelHandler.java
diff --git a/src/test/java/io/netty/channel/socket/http/SaturationManagerTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/SaturationManagerTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/SaturationManagerTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/SaturationManagerTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/ServerMessageSwitchTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/ServerMessageSwitchTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/ServerMessageSwitchTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/ServerMessageSwitchTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/UpstreamEventCatcher.java b/transport-http/src/test/java/io/netty/channel/socket/http/UpstreamEventCatcher.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/UpstreamEventCatcher.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/UpstreamEventCatcher.java
diff --git a/src/test/java/io/netty/channel/socket/http/WriteFragmenterTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/WriteFragmenterTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/WriteFragmenterTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/WriteFragmenterTest.java
diff --git a/src/test/java/io/netty/channel/socket/http/WriteSplitterTest.java b/transport-http/src/test/java/io/netty/channel/socket/http/WriteSplitterTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/socket/http/WriteSplitterTest.java
rename to transport-http/src/test/java/io/netty/channel/socket/http/WriteSplitterTest.java
diff --git a/transport-rxtx/pom.xml b/transport-rxtx/pom.xml
new file mode 100644
index 0000000000..ca39dd2e2c
--- /dev/null
+++ b/transport-rxtx/pom.xml
@@ -0,0 +1,44 @@
+
+
+
+
+ 4.0.0
+
+ io.netty
+ netty-parent
+ 4.0.0.Alpha1-SNAPSHOT
+
+
+ io.netty
+ netty-transport-rxtx
+ jar
+
+ Netty/Transport/RXTX
+
+
+
+ ${project.groupId}
+ netty-transport
+ ${project.version}
+
+
+ org.rxtx
+ rxtx
+
+
+
+
diff --git a/src/main/java/io/netty/channel/rxtx/RXTXChannel.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RXTXChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/rxtx/RXTXChannel.java
rename to transport-rxtx/src/main/java/io/netty/channel/rxtx/RXTXChannel.java
diff --git a/src/main/java/io/netty/channel/rxtx/RXTXChannelConfig.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RXTXChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/rxtx/RXTXChannelConfig.java
rename to transport-rxtx/src/main/java/io/netty/channel/rxtx/RXTXChannelConfig.java
diff --git a/src/main/java/io/netty/channel/rxtx/RXTXChannelFactory.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RXTXChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/rxtx/RXTXChannelFactory.java
rename to transport-rxtx/src/main/java/io/netty/channel/rxtx/RXTXChannelFactory.java
diff --git a/src/main/java/io/netty/channel/rxtx/RXTXChannelSink.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RXTXChannelSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/rxtx/RXTXChannelSink.java
rename to transport-rxtx/src/main/java/io/netty/channel/rxtx/RXTXChannelSink.java
diff --git a/src/main/java/io/netty/channel/rxtx/RXTXDeviceAddress.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RXTXDeviceAddress.java
similarity index 100%
rename from src/main/java/io/netty/channel/rxtx/RXTXDeviceAddress.java
rename to transport-rxtx/src/main/java/io/netty/channel/rxtx/RXTXDeviceAddress.java
diff --git a/transport-sctp/pom.xml b/transport-sctp/pom.xml
new file mode 100644
index 0000000000..c14941d722
--- /dev/null
+++ b/transport-sctp/pom.xml
@@ -0,0 +1,39 @@
+
+
+
+
+ 4.0.0
+
+ io.netty
+ netty-parent
+ 4.0.0.Alpha1-SNAPSHOT
+
+
+ io.netty
+ netty-transport-sctp
+ jar
+
+ Netty/Transport/SCTP
+
+
+
+ ${project.groupId}
+ netty-transport
+ ${project.version}
+
+
+
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/AbstractNotificationHandler.java b/transport-sctp/src/main/java/com/sun/nio/sctp/AbstractNotificationHandler.java
new file mode 100644
index 0000000000..bade95b264
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/AbstractNotificationHandler.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+public class AbstractNotificationHandler implements NotificationHandler {
+ static {
+ UnsupportedOperatingSystemException.raise();
+ }
+
+ public HandlerResult handleNotification(AssociationChangeNotification notification, Object o) {
+ return null;
+ }
+
+ public HandlerResult handleNotification(Notification notification, Object o) {
+ return null;
+ }
+
+ public HandlerResult handleNotification(PeerAddressChangeNotification notification, Object o) {
+ return null;
+ }
+
+ public HandlerResult handleNotification(SendFailedNotification notification, Object o) {
+ return null;
+ }
+
+ public HandlerResult handleNotification(ShutdownNotification notification, Object o) {
+ return null;
+ }
+}
diff --git a/src/main/java/io/netty/container/osgi/package-info.java b/transport-sctp/src/main/java/com/sun/nio/sctp/Association.java
similarity index 83%
rename from src/main/java/io/netty/container/osgi/package-info.java
rename to transport-sctp/src/main/java/com/sun/nio/sctp/Association.java
index f146965fa3..e190295f5e 100644
--- a/src/main/java/io/netty/container/osgi/package-info.java
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/Association.java
@@ -13,10 +13,10 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
+package com.sun.nio.sctp;
-/**
- * OSGi framework integration.
- *
- * @apiviz.exclude
- */
-package io.netty.container.osgi;
+public class Association {
+ static {
+ UnsupportedOperatingSystemException.raise();
+ }
+}
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/AssociationChangeNotification.java b/transport-sctp/src/main/java/com/sun/nio/sctp/AssociationChangeNotification.java
new file mode 100644
index 0000000000..8b8098c851
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/AssociationChangeNotification.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+public abstract class AssociationChangeNotification implements Notification {
+ static {
+ UnsupportedOperatingSystemException.raise();
+ }
+}
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/HandlerResult.java b/transport-sctp/src/main/java/com/sun/nio/sctp/HandlerResult.java
new file mode 100644
index 0000000000..f75088140b
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/HandlerResult.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+/**
+ * TODO Document me.
+ *
+ * @author Trustin Lee
+ */
+public enum HandlerResult {
+ CONTINUE, RETURN;
+}
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/MessageInfo.java b/transport-sctp/src/main/java/com/sun/nio/sctp/MessageInfo.java
new file mode 100644
index 0000000000..bab8487f3f
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/MessageInfo.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+import java.net.SocketAddress;
+
+public abstract class MessageInfo {
+ static {
+ UnsupportedOperatingSystemException.raise();
+ }
+
+ public static MessageInfo createOutgoing(Association association, SocketAddress address, int streamNumber) {
+ return null;
+ }
+
+ public abstract SocketAddress address();
+ public abstract int streamNumber();
+ public abstract MessageInfo streamNumber(int streamNumber);
+ public abstract int payloadProtocolID();
+ public abstract MessageInfo payloadProtocolID(int ppid);
+ public abstract boolean isComplete();
+
+}
diff --git a/src/main/java/io/netty/container/spring/package-info.java b/transport-sctp/src/main/java/com/sun/nio/sctp/Notification.java
similarity index 81%
rename from src/main/java/io/netty/container/spring/package-info.java
rename to transport-sctp/src/main/java/com/sun/nio/sctp/Notification.java
index 42a55f3152..32f1a809c9 100644
--- a/src/main/java/io/netty/container/spring/package-info.java
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/Notification.java
@@ -13,10 +13,8 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
+package com.sun.nio.sctp;
-/**
- * Spring framework integration.
- *
- * @apiviz.exclude
- */
-package io.netty.container.spring;
+public interface Notification {
+ Association association();
+}
diff --git a/src/main/java/io/netty/container/microcontainer/package-info.java b/transport-sctp/src/main/java/com/sun/nio/sctp/NotificationHandler.java
similarity index 80%
rename from src/main/java/io/netty/container/microcontainer/package-info.java
rename to transport-sctp/src/main/java/com/sun/nio/sctp/NotificationHandler.java
index 485a26f619..1b86c0c57e 100644
--- a/src/main/java/io/netty/container/microcontainer/package-info.java
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/NotificationHandler.java
@@ -13,10 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
+package com.sun.nio.sctp;
-/**
- * JBoss Microcontainer integration.
- *
- * @apiviz.exclude
- */
-package io.netty.container.microcontainer;
+public interface NotificationHandler {
+}
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/PeerAddressChangeNotification.java b/transport-sctp/src/main/java/com/sun/nio/sctp/PeerAddressChangeNotification.java
new file mode 100644
index 0000000000..7c61551edb
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/PeerAddressChangeNotification.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+public abstract class PeerAddressChangeNotification implements Notification {
+ static {
+ UnsupportedOperatingSystemException.raise();
+ }
+}
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpChannel.java b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpChannel.java
new file mode 100644
index 0000000000..287c40041b
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpChannel.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+import java.io.IOException;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.spi.AbstractSelectableChannel;
+import java.nio.channels.spi.SelectorProvider;
+import java.util.Set;
+
+public abstract class SctpChannel extends AbstractSelectableChannel {
+ static {
+ UnsupportedOperatingSystemException.raise();
+ }
+
+ public static SctpChannel open() throws IOException {
+ return null;
+ }
+
+ protected SctpChannel(SelectorProvider provider) {
+ super(provider);
+ }
+
+ public abstract T getOption(SctpSocketOption name) throws IOException;
+ public abstract SctpChannel setOption(SctpSocketOption name, T value) throws IOException;
+
+ public abstract Set getAllLocalAddresses() throws IOException;
+ public abstract Set getRemoteAddresses() throws IOException;
+
+ public abstract Association association() throws IOException;
+ public abstract SctpChannel bind(SocketAddress local) throws IOException;
+ public abstract boolean connect(SocketAddress remote) throws IOException;
+ public abstract boolean finishConnect() throws IOException;
+ public abstract MessageInfo receive(ByteBuffer dst, T attachment, NotificationHandler handler) throws IOException;
+ public abstract int send(ByteBuffer src, MessageInfo messageInfo) throws IOException;
+}
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpServerChannel.java b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpServerChannel.java
new file mode 100644
index 0000000000..772a768825
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpServerChannel.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+import java.io.IOException;
+import java.net.SocketAddress;
+import java.nio.channels.spi.AbstractSelectableChannel;
+import java.nio.channels.spi.SelectorProvider;
+import java.util.Set;
+
+public abstract class SctpServerChannel extends AbstractSelectableChannel {
+ static {
+ UnsupportedOperatingSystemException.raise();
+ }
+
+ public static SctpServerChannel open() throws IOException {
+ return null;
+ }
+
+ protected SctpServerChannel(SelectorProvider provider) {
+ super(provider);
+ }
+
+ public abstract T getOption(SctpSocketOption name) throws IOException;
+ public abstract SctpChannel setOption(SctpSocketOption name, T value) throws IOException;
+
+ public abstract Set getAllLocalAddresses() throws IOException;
+
+ public abstract SctpServerChannel bind(SocketAddress local) throws IOException;
+ public abstract SctpServerChannel bind(SocketAddress local, int backlog) throws IOException;
+ public abstract SctpChannel accept() throws IOException;
+}
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpSocketOption.java b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpSocketOption.java
new file mode 100644
index 0000000000..66ca504ceb
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpSocketOption.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+public interface SctpSocketOption {
+ String name();
+ Class type();
+}
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/SctpStandardSocketOptions.java b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpStandardSocketOptions.java
new file mode 100644
index 0000000000..f5418a9b31
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/SctpStandardSocketOptions.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+import java.net.SocketAddress;
+
+public class SctpStandardSocketOptions {
+ static {
+ UnsupportedOperatingSystemException.raise();
+ }
+
+ public static final SctpSocketOption SCTP_DISABLE_FRAGMENTS = null;
+ public static final SctpSocketOption SCTP_EXPLICIT_COMPLETE = null;
+ public static final SctpSocketOption SCTP_FRAGMENT_INTERLEAVE = null;
+ public static final SctpSocketOption SCTP_INIT_MAXSTREAMS = null;
+ public static final SctpSocketOption SCTP_NODELAY = null;
+ public static final SctpSocketOption SCTP_PRIMARY_ADDR = null;
+ public static final SctpSocketOption SCTP_SET_PEER_PRIMARY_ADDR = null;
+ public static final SctpSocketOption SO_LINGER = null;
+ public static final SctpSocketOption SO_RCVBUF = null;
+ public static final SctpSocketOption SO_SNDBUF = null;
+
+ public static class InitMaxStreams {
+ }
+}
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/SendFailedNotification.java b/transport-sctp/src/main/java/com/sun/nio/sctp/SendFailedNotification.java
new file mode 100644
index 0000000000..47bbe89ad9
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/SendFailedNotification.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+public abstract class SendFailedNotification implements Notification {
+ static {
+ UnsupportedOperatingSystemException.raise();
+ }
+}
diff --git a/transport-sctp/src/main/java/com/sun/nio/sctp/ShutdownNotification.java b/transport-sctp/src/main/java/com/sun/nio/sctp/ShutdownNotification.java
new file mode 100644
index 0000000000..d0f408c2da
--- /dev/null
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/ShutdownNotification.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package com.sun.nio.sctp;
+
+public abstract class ShutdownNotification implements Notification {
+ static {
+ UnsupportedOperatingSystemException.raise();
+ }
+}
diff --git a/src/main/java/io/netty/container/spring/NettyLoggerConfigurator.java b/transport-sctp/src/main/java/com/sun/nio/sctp/UnsupportedOperatingSystemException.java
similarity index 52%
rename from src/main/java/io/netty/container/spring/NettyLoggerConfigurator.java
rename to transport-sctp/src/main/java/com/sun/nio/sctp/UnsupportedOperatingSystemException.java
index 295048a76e..ad990c757f 100644
--- a/src/main/java/io/netty/container/spring/NettyLoggerConfigurator.java
+++ b/transport-sctp/src/main/java/com/sun/nio/sctp/UnsupportedOperatingSystemException.java
@@ -13,16 +13,26 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.container.spring;
+package com.sun.nio.sctp;
-import io.netty.logging.CommonsLoggerFactory;
-import io.netty.logging.InternalLoggerFactory;
+public class UnsupportedOperatingSystemException extends RuntimeException {
+ public static void raise() {
+ throw new UnsupportedOperatingSystemException();
+ }
-/**
- * A bean that configures the default {@link InternalLoggerFactory}.
- */
-public class NettyLoggerConfigurator {
- public NettyLoggerConfigurator() {
- InternalLoggerFactory.setDefaultFactory(new CommonsLoggerFactory());
+ public UnsupportedOperatingSystemException() {
+ super();
+ }
+
+ public UnsupportedOperatingSystemException(String message) {
+ super(message);
+ }
+
+ public UnsupportedOperatingSystemException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public UnsupportedOperatingSystemException(Throwable cause) {
+ super(cause);
}
}
diff --git a/transport-sctp/src/main/java/io/netty/channel/sctp/AbstractWriteRequestQueue.java b/transport-sctp/src/main/java/io/netty/channel/sctp/AbstractWriteRequestQueue.java
new file mode 100644
index 0000000000..b2b6ce436d
--- /dev/null
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/AbstractWriteRequestQueue.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright 2011 The Netty Project
+ *
+ * The Netty Project licenses this file to you under the Apache License,
+ * version 2.0 (the "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+package io.netty.channel.sctp;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+import io.netty.channel.MessageEvent;
+import io.netty.util.internal.QueueFactory;
+
+abstract class AbstractWriteRequestQueue implements BlockingQueue {
+
+ protected final BlockingQueue queue;
+
+ public AbstractWriteRequestQueue() {
+ this.queue = QueueFactory.createQueue(MessageEvent.class);
+ }
+
+ @Override
+ public MessageEvent remove() {
+ return queue.remove();
+ }
+
+ @Override
+ public MessageEvent element() {
+ return queue.element();
+ }
+
+ @Override
+ public MessageEvent peek() {
+ return queue.peek();
+ }
+
+ @Override
+ public int size() {
+ return queue.size();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return queue.isEmpty();
+ }
+
+ @Override
+ public Iterator iterator() {
+ return queue.iterator();
+ }
+
+ @Override
+ public Object[] toArray() {
+ return queue.toArray();
+ }
+
+ @Override
+ public T[] toArray(T[] a) {
+ return queue.toArray(a);
+ }
+
+ @Override
+ public boolean containsAll(Collection> c) {
+ return queue.containsAll(c);
+ }
+
+ @Override
+ public boolean addAll(Collection extends MessageEvent> c) {
+ return queue.addAll(c);
+ }
+
+ @Override
+ public boolean removeAll(Collection> c) {
+ return queue.removeAll(c);
+ }
+
+ @Override
+ public boolean retainAll(Collection> c) {
+ return queue.retainAll(c);
+ }
+
+ @Override
+ public void clear() {
+ queue.clear();
+ }
+
+ @Override
+ public boolean add(MessageEvent e) {
+ return queue.add(e);
+ }
+
+ @Override
+ public void put(MessageEvent e) throws InterruptedException {
+ queue.put(e);
+ }
+
+ @Override
+ public boolean offer(MessageEvent e, long timeout, TimeUnit unit) throws InterruptedException {
+ return queue.offer(e, timeout, unit);
+ }
+
+ @Override
+ public MessageEvent take() throws InterruptedException {
+ return queue.take();
+ }
+
+ @Override
+ public MessageEvent poll(long timeout, TimeUnit unit) throws InterruptedException {
+ return queue.poll(timeout, unit);
+ }
+
+ @Override
+ public int remainingCapacity() {
+ return queue.remainingCapacity();
+ }
+
+ @Override
+ public boolean remove(Object o) {
+ return queue.remove(o);
+ }
+
+ @Override
+ public boolean contains(Object o) {
+ return queue.contains(o);
+ }
+
+ @Override
+ public int drainTo(Collection super MessageEvent> c) {
+ return queue.drainTo(c);
+ }
+
+ @Override
+ public int drainTo(Collection super MessageEvent> c, int maxElements) {
+ return queue.drainTo(c, maxElements);
+ }
+
+}
diff --git a/src/main/java/io/netty/channel/socket/sctp/DefaultNioSctpChannelConfig.java b/transport-sctp/src/main/java/io/netty/channel/sctp/DefaultNioSctpChannelConfig.java
similarity index 99%
rename from src/main/java/io/netty/channel/socket/sctp/DefaultNioSctpChannelConfig.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/DefaultNioSctpChannelConfig.java
index 46c83e7155..7fc830413f 100644
--- a/src/main/java/io/netty/channel/socket/sctp/DefaultNioSctpChannelConfig.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/DefaultNioSctpChannelConfig.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.SctpChannel;
import java.util.Map;
diff --git a/src/main/java/io/netty/channel/socket/sctp/DefaultSctpChannelConfig.java b/transport-sctp/src/main/java/io/netty/channel/sctp/DefaultSctpChannelConfig.java
similarity index 99%
rename from src/main/java/io/netty/channel/socket/sctp/DefaultSctpChannelConfig.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/DefaultSctpChannelConfig.java
index a5bff95e82..25d667951d 100644
--- a/src/main/java/io/netty/channel/socket/sctp/DefaultSctpChannelConfig.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/DefaultSctpChannelConfig.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.SctpChannel;
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
diff --git a/src/main/java/io/netty/channel/socket/sctp/DefaultSctpServerChannelConfig.java b/transport-sctp/src/main/java/io/netty/channel/sctp/DefaultSctpServerChannelConfig.java
similarity index 98%
rename from src/main/java/io/netty/channel/socket/sctp/DefaultSctpServerChannelConfig.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/DefaultSctpServerChannelConfig.java
index 04e876a2a4..b311b31c0b 100644
--- a/src/main/java/io/netty/channel/socket/sctp/DefaultSctpServerChannelConfig.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/DefaultSctpServerChannelConfig.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
diff --git a/src/main/java/io/netty/channel/socket/sctp/NioSctpChannelConfig.java b/transport-sctp/src/main/java/io/netty/channel/sctp/NioSctpChannelConfig.java
similarity index 95%
rename from src/main/java/io/netty/channel/socket/sctp/NioSctpChannelConfig.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/NioSctpChannelConfig.java
index cab189a377..69f8fe791d 100644
--- a/src/main/java/io/netty/channel/socket/sctp/NioSctpChannelConfig.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/NioSctpChannelConfig.java
@@ -13,19 +13,19 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import io.netty.channel.ReceiveBufferSizePredictor;
import io.netty.channel.ReceiveBufferSizePredictorFactory;
import io.netty.channel.socket.SocketChannelConfig;
/**
- * A {@link io.netty.channel.socket.sctp.SctpChannelConfig} for a NIO SCTP/IP {@link io.netty.channel.socket.sctp.SctpChannel}.
+ * A {@link io.netty.channel.sctp.SctpChannelConfig} for a NIO SCTP/IP {@link io.netty.channel.sctp.SctpChannel}.
*
* Available options
*
* In addition to the options provided by {@link io.netty.channel.ChannelConfig} and
- * {@link io.netty.channel.socket.sctp.SctpChannelConfig}, {@link io.netty.channel.socket.sctp.NioSctpChannelConfig} allows the
+ * {@link io.netty.channel.sctp.SctpChannelConfig}, {@link io.netty.channel.sctp.NioSctpChannelConfig} allows the
* following options in the option map:
*
*
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpAcceptedChannel.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpAcceptedChannel.java
similarity index 97%
rename from src/main/java/io/netty/channel/socket/sctp/SctpAcceptedChannel.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpAcceptedChannel.java
index 9fc99d9ac8..7996280614 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpAcceptedChannel.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpAcceptedChannel.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.SctpChannel;
import io.netty.channel.Channel;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpChannel.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannel.java
similarity index 97%
rename from src/main/java/io/netty/channel/socket/sctp/SctpChannel.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannel.java
index a3f4c2cb28..df0b9392ac 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpChannel.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannel.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.Association;
import io.netty.channel.Channel;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpChannelConfig.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelConfig.java
similarity index 95%
rename from src/main/java/io/netty/channel/socket/sctp/SctpChannelConfig.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelConfig.java
index c0c994d581..bf67ec3ac2 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpChannelConfig.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelConfig.java
@@ -13,18 +13,18 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
import io.netty.channel.ChannelConfig;
/**
- * A {@link io.netty.channel.ChannelConfig} for a {@link io.netty.channel.socket.sctp.SctpChannel}.
+ * A {@link io.netty.channel.ChannelConfig} for a {@link io.netty.channel.sctp.SctpChannel}.
*
* Available options
*
* In addition to the options provided by {@link io.netty.channel.ChannelConfig},
- * {@link io.netty.channel.socket.sctp.SctpChannelConfig} allows the following options in the option map:
+ * {@link io.netty.channel.sctp.SctpChannelConfig} allows the following options in the option map:
*
*
*
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpChannelImpl.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelImpl.java
similarity index 96%
rename from src/main/java/io/netty/channel/socket/sctp/SctpChannelImpl.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelImpl.java
index b882c02655..c87df7e0a9 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpChannelImpl.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelImpl.java
@@ -13,18 +13,17 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.Association;
import io.netty.buffer.ChannelBuffer;
import io.netty.channel.*;
-import io.netty.channel.socket.sctp.SctpSendBufferPool.SendBuffer;
+import io.netty.channel.sctp.SctpSendBufferPool.SendBuffer;
import io.netty.util.internal.ThreadLocalBoolean;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.*;
-import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -230,7 +229,7 @@ class SctpChannelImpl extends AbstractChannel implements SctpChannel {
}
}
- private final class WriteRequestQueue extends LinkedTransferQueue {
+ private final class WriteRequestQueue extends AbstractWriteRequestQueue {
private static final long serialVersionUID = -246694024103520626L;
@@ -242,7 +241,7 @@ class SctpChannelImpl extends AbstractChannel implements SctpChannel {
@Override
public boolean offer(MessageEvent e) {
- boolean success = super.offer(e);
+ boolean success = queue.offer(e);
assert success;
int messageSize = getMessageSize(e);
@@ -264,7 +263,7 @@ class SctpChannelImpl extends AbstractChannel implements SctpChannel {
@Override
public MessageEvent poll() {
- MessageEvent e = super.poll();
+ MessageEvent e = queue.poll();
if (e != null) {
int messageSize = getMessageSize(e);
int newWriteBufferSize = writeBufferSize.addAndGet(-messageSize);
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpClientChannel.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpClientChannel.java
similarity index 98%
rename from src/main/java/io/netty/channel/socket/sctp/SctpClientChannel.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpClientChannel.java
index e58627c48a..ba4615584f 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpClientChannel.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpClientChannel.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.SctpChannel;
import io.netty.channel.*;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpClientPipelineSink.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpClientPipelineSink.java
similarity index 98%
rename from src/main/java/io/netty/channel/socket/sctp/SctpClientPipelineSink.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpClientPipelineSink.java
index a6654c451a..0ac7287ab9 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpClientPipelineSink.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpClientPipelineSink.java
@@ -13,12 +13,13 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import io.netty.channel.*;
import io.netty.logging.InternalLogger;
import io.netty.logging.InternalLoggerFactory;
import io.netty.util.internal.DeadLockProofWorker;
+import io.netty.util.internal.QueueFactory;
import java.io.IOException;
import java.net.ConnectException;
@@ -31,7 +32,6 @@ import java.util.Queue;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
@@ -156,7 +156,7 @@ class SctpClientPipelineSink extends AbstractChannelSink {
private boolean started;
private final AtomicBoolean wakenUp = new AtomicBoolean();
private final Object startStopLock = new Object();
- private final Queue registerTaskQueue = new LinkedTransferQueue();
+ private final Queue registerTaskQueue = QueueFactory.createQueue(Runnable.class);
Boss() {
super();
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpClientSocketChannelFactory.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpClientSocketChannelFactory.java
similarity index 99%
rename from src/main/java/io/netty/channel/socket/sctp/SctpClientSocketChannelFactory.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpClientSocketChannelFactory.java
index 6972931e7a..151e490b64 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpClientSocketChannelFactory.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpClientSocketChannelFactory.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import io.netty.channel.ChannelFactory;
import io.netty.channel.ChannelPipeline;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpNotificationEvent.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpNotificationEvent.java
similarity index 97%
rename from src/main/java/io/netty/channel/socket/sctp/SctpNotificationEvent.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpNotificationEvent.java
index b5dcae216e..9835dd24c7 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpNotificationEvent.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpNotificationEvent.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.Notification;
import io.netty.channel.Channel;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpNotificationHandler.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpNotificationHandler.java
similarity index 98%
rename from src/main/java/io/netty/channel/socket/sctp/SctpNotificationHandler.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpNotificationHandler.java
index 56596ae0e2..ed8b22a958 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpNotificationHandler.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpNotificationHandler.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.*;
import io.netty.channel.Channels;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpPayload.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpPayload.java
similarity index 98%
rename from src/main/java/io/netty/channel/socket/sctp/SctpPayload.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpPayload.java
index 28a6babdaf..e773a34083 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpPayload.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpPayload.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import io.netty.buffer.ChannelBuffer;
import io.netty.buffer.ChannelBuffers;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpProviderMetadata.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpProviderMetadata.java
similarity index 99%
rename from src/main/java/io/netty/channel/socket/sctp/SctpProviderMetadata.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpProviderMetadata.java
index 91a736f986..db8ce4bb1a 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpProviderMetadata.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpProviderMetadata.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.SctpServerChannel;
import io.netty.logging.InternalLogger;
@@ -42,7 +42,7 @@ class SctpProviderMetadata {
InternalLoggerFactory.getInstance(SctpProviderMetadata.class);
private static final String CONSTRAINT_LEVEL_PROPERTY =
- "io.netty.channel.socket.sctp.constraintLevel";
+ "io.netty.channel.sctp.constraintLevel";
/**
* 0 - no need to wake up to get / set interestOps (most cases)
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpReceiveBufferPool.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpReceiveBufferPool.java
similarity index 98%
rename from src/main/java/io/netty/channel/socket/sctp/SctpReceiveBufferPool.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpReceiveBufferPool.java
index 6749155e4e..45484cb1f1 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpReceiveBufferPool.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpReceiveBufferPool.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import java.lang.ref.SoftReference;
import java.nio.ByteBuffer;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpSendBufferPool.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpSendBufferPool.java
similarity index 99%
rename from src/main/java/io/netty/channel/socket/sctp/SctpSendBufferPool.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpSendBufferPool.java
index 7fdcdebabc..f28babde6b 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpSendBufferPool.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpSendBufferPool.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.MessageInfo;
import com.sun.nio.sctp.SctpChannel;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpServerChannel.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerChannel.java
similarity index 97%
rename from src/main/java/io/netty/channel/socket/sctp/SctpServerChannel.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerChannel.java
index 3e73b49a1f..2fb186cb98 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpServerChannel.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerChannel.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import io.netty.channel.ServerChannel;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpServerChannelConfig.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerChannelConfig.java
similarity index 98%
rename from src/main/java/io/netty/channel/socket/sctp/SctpServerChannelConfig.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerChannelConfig.java
index f4fbc4040a..82732220a5 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpServerChannelConfig.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerChannelConfig.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpServerChannelImpl.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerChannelImpl.java
similarity index 99%
rename from src/main/java/io/netty/channel/socket/sctp/SctpServerChannelImpl.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerChannelImpl.java
index 24719eed73..2bb7ba1484 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpServerChannelImpl.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerChannelImpl.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import io.netty.channel.*;
import io.netty.logging.InternalLogger;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpServerPipelineSink.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerPipelineSink.java
similarity index 99%
rename from src/main/java/io/netty/channel/socket/sctp/SctpServerPipelineSink.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerPipelineSink.java
index 8283a5b7fb..f89144dfa6 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpServerPipelineSink.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerPipelineSink.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.SctpChannel;
import io.netty.channel.*;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpServerSocketChannelFactory.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerSocketChannelFactory.java
similarity index 99%
rename from src/main/java/io/netty/channel/socket/sctp/SctpServerSocketChannelFactory.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerSocketChannelFactory.java
index 57e1fcab17..7ac54e1fdc 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpServerSocketChannelFactory.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpServerSocketChannelFactory.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ChannelSink;
diff --git a/src/main/java/io/netty/channel/socket/sctp/SctpWorker.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpWorker.java
similarity index 98%
rename from src/main/java/io/netty/channel/socket/sctp/SctpWorker.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SctpWorker.java
index 2e40de6963..a2ebbcbf78 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SctpWorker.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpWorker.java
@@ -13,17 +13,18 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import com.sun.nio.sctp.*;
import io.netty.buffer.ChannelBuffer;
import io.netty.buffer.ChannelBufferFactory;
import io.netty.channel.Channel;
import io.netty.channel.*;
-import io.netty.channel.socket.sctp.SctpSendBufferPool.SendBuffer;
+import io.netty.channel.sctp.SctpSendBufferPool.SendBuffer;
import io.netty.logging.InternalLogger;
import io.netty.logging.InternalLoggerFactory;
import io.netty.util.internal.DeadLockProofWorker;
+import io.netty.util.internal.QueueFactory;
import java.io.IOException;
import java.net.SocketAddress;
@@ -34,7 +35,6 @@ import java.util.Queue;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedTransferQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -60,8 +60,8 @@ class SctpWorker implements Runnable {
private final AtomicBoolean wakenUp = new AtomicBoolean();
private final ReadWriteLock selectorGuard = new ReentrantReadWriteLock();
private final Object startStopLock = new Object();
- private final Queue registerTaskQueue = new LinkedTransferQueue();
- private final Queue writeTaskQueue = new LinkedTransferQueue();
+ private final Queue registerTaskQueue = QueueFactory.createQueue(Runnable.class);
+ private final Queue writeTaskQueue = QueueFactory.createQueue(Runnable.class);
private volatile int cancelledKeys; // should use AtomicInteger but we just need approximation
private final SctpReceiveBufferPool recvBufferPool = new SctpReceiveBufferPool();
diff --git a/src/main/java/io/netty/channel/socket/sctp/SelectorUtil.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SelectorUtil.java
similarity index 97%
rename from src/main/java/io/netty/channel/socket/sctp/SelectorUtil.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/SelectorUtil.java
index 8a4bc5af29..e027247d5d 100644
--- a/src/main/java/io/netty/channel/socket/sctp/SelectorUtil.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SelectorUtil.java
@@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
import io.netty.logging.InternalLogger;
import io.netty.logging.InternalLoggerFactory;
diff --git a/src/main/java/io/netty/channel/socket/sctp/package-info.java b/transport-sctp/src/main/java/io/netty/channel/sctp/package-info.java
similarity index 95%
rename from src/main/java/io/netty/channel/socket/sctp/package-info.java
rename to transport-sctp/src/main/java/io/netty/channel/sctp/package-info.java
index 95e64a58eb..d99e070321 100644
--- a/src/main/java/io/netty/channel/socket/sctp/package-info.java
+++ b/transport-sctp/src/main/java/io/netty/channel/sctp/package-info.java
@@ -18,4 +18,4 @@
* NIO-based socket channel
* API implementation - recommended for a large number of connections (>= 1000).
*/
-package io.netty.channel.socket.sctp;
+package io.netty.channel.sctp;
diff --git a/transport/pom.xml b/transport/pom.xml
new file mode 100644
index 0000000000..01f293a234
--- /dev/null
+++ b/transport/pom.xml
@@ -0,0 +1,40 @@
+
+
+
+
+ 4.0.0
+
+ io.netty
+ netty-parent
+ 4.0.0.Alpha1-SNAPSHOT
+
+
+ io.netty
+ netty-transport
+ jar
+
+ Netty/Transport
+
+
+
+ ${project.groupId}
+ netty-buffer
+ ${project.version}
+
+
+
+
diff --git a/src/main/java/io/netty/bootstrap/Bootstrap.java b/transport/src/main/java/io/netty/bootstrap/Bootstrap.java
similarity index 100%
rename from src/main/java/io/netty/bootstrap/Bootstrap.java
rename to transport/src/main/java/io/netty/bootstrap/Bootstrap.java
diff --git a/src/main/java/io/netty/bootstrap/ClientBootstrap.java b/transport/src/main/java/io/netty/bootstrap/ClientBootstrap.java
similarity index 100%
rename from src/main/java/io/netty/bootstrap/ClientBootstrap.java
rename to transport/src/main/java/io/netty/bootstrap/ClientBootstrap.java
diff --git a/src/main/java/io/netty/bootstrap/ConnectionlessBootstrap.java b/transport/src/main/java/io/netty/bootstrap/ConnectionlessBootstrap.java
similarity index 100%
rename from src/main/java/io/netty/bootstrap/ConnectionlessBootstrap.java
rename to transport/src/main/java/io/netty/bootstrap/ConnectionlessBootstrap.java
diff --git a/src/main/java/io/netty/bootstrap/ServerBootstrap.java b/transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java
similarity index 100%
rename from src/main/java/io/netty/bootstrap/ServerBootstrap.java
rename to transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java
diff --git a/src/main/java/io/netty/bootstrap/package-info.java b/transport/src/main/java/io/netty/bootstrap/package-info.java
similarity index 100%
rename from src/main/java/io/netty/bootstrap/package-info.java
rename to transport/src/main/java/io/netty/bootstrap/package-info.java
diff --git a/src/main/java/io/netty/channel/AbstractChannel.java b/transport/src/main/java/io/netty/channel/AbstractChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/AbstractChannel.java
rename to transport/src/main/java/io/netty/channel/AbstractChannel.java
diff --git a/src/main/java/io/netty/channel/AbstractChannelSink.java b/transport/src/main/java/io/netty/channel/AbstractChannelSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/AbstractChannelSink.java
rename to transport/src/main/java/io/netty/channel/AbstractChannelSink.java
diff --git a/src/main/java/io/netty/channel/AbstractServerChannel.java b/transport/src/main/java/io/netty/channel/AbstractServerChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/AbstractServerChannel.java
rename to transport/src/main/java/io/netty/channel/AbstractServerChannel.java
diff --git a/src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictor.java b/transport/src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictor.java
similarity index 100%
rename from src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictor.java
rename to transport/src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictor.java
diff --git a/src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictorFactory.java b/transport/src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictorFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictorFactory.java
rename to transport/src/main/java/io/netty/channel/AdaptiveReceiveBufferSizePredictorFactory.java
diff --git a/src/main/java/io/netty/channel/Channel.java b/transport/src/main/java/io/netty/channel/Channel.java
similarity index 100%
rename from src/main/java/io/netty/channel/Channel.java
rename to transport/src/main/java/io/netty/channel/Channel.java
diff --git a/src/main/java/io/netty/channel/ChannelConfig.java b/transport/src/main/java/io/netty/channel/ChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelConfig.java
rename to transport/src/main/java/io/netty/channel/ChannelConfig.java
diff --git a/src/main/java/io/netty/channel/ChannelDownstreamHandler.java b/transport/src/main/java/io/netty/channel/ChannelDownstreamHandler.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelDownstreamHandler.java
rename to transport/src/main/java/io/netty/channel/ChannelDownstreamHandler.java
diff --git a/src/main/java/io/netty/channel/ChannelEvent.java b/transport/src/main/java/io/netty/channel/ChannelEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelEvent.java
rename to transport/src/main/java/io/netty/channel/ChannelEvent.java
diff --git a/src/main/java/io/netty/channel/ChannelException.java b/transport/src/main/java/io/netty/channel/ChannelException.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelException.java
rename to transport/src/main/java/io/netty/channel/ChannelException.java
diff --git a/src/main/java/io/netty/channel/ChannelFactory.java b/transport/src/main/java/io/netty/channel/ChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelFactory.java
rename to transport/src/main/java/io/netty/channel/ChannelFactory.java
diff --git a/src/main/java/io/netty/channel/ChannelFuture.java b/transport/src/main/java/io/netty/channel/ChannelFuture.java
similarity index 97%
rename from src/main/java/io/netty/channel/ChannelFuture.java
rename to transport/src/main/java/io/netty/channel/ChannelFuture.java
index 48baa7b1ff..0938c2963a 100644
--- a/src/main/java/io/netty/channel/ChannelFuture.java
+++ b/transport/src/main/java/io/netty/channel/ChannelFuture.java
@@ -18,7 +18,6 @@ package io.netty.channel;
import java.util.concurrent.TimeUnit;
import io.netty.bootstrap.ClientBootstrap;
-import io.netty.handler.execution.ExecutionHandler;
/**
* The result of an asynchronous {@link Channel} I/O operation.
@@ -84,9 +83,8 @@ import io.netty.handler.execution.ExecutionHandler;
*
* Do not call {@link #await()} inside {@link ChannelHandler}
*
- * The event handler methods in {@link ChannelHandler} is often called by
- * an I/O thread unless an {@link ExecutionHandler} is in the
- * {@link ChannelPipeline}. If {@link #await()} is called by an event handler
+ * The event handler methods in {@link ChannelHandler} is usually called by
+ * an I/O thread. If {@link #await()} is called by an event handler
* method, which is called by the I/O thread, the I/O operation it is waiting
* for might never be complete because {@link #await()} can block the I/O
* operation it is waiting for, which is a dead lock.
diff --git a/src/main/java/io/netty/channel/ChannelFutureAggregator.java b/transport/src/main/java/io/netty/channel/ChannelFutureAggregator.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelFutureAggregator.java
rename to transport/src/main/java/io/netty/channel/ChannelFutureAggregator.java
diff --git a/src/main/java/io/netty/channel/ChannelFutureListener.java b/transport/src/main/java/io/netty/channel/ChannelFutureListener.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelFutureListener.java
rename to transport/src/main/java/io/netty/channel/ChannelFutureListener.java
diff --git a/src/main/java/io/netty/channel/ChannelFutureProgressListener.java b/transport/src/main/java/io/netty/channel/ChannelFutureProgressListener.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelFutureProgressListener.java
rename to transport/src/main/java/io/netty/channel/ChannelFutureProgressListener.java
diff --git a/src/main/java/io/netty/channel/ChannelHandler.java b/transport/src/main/java/io/netty/channel/ChannelHandler.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelHandler.java
rename to transport/src/main/java/io/netty/channel/ChannelHandler.java
diff --git a/src/main/java/io/netty/channel/ChannelHandlerContext.java b/transport/src/main/java/io/netty/channel/ChannelHandlerContext.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelHandlerContext.java
rename to transport/src/main/java/io/netty/channel/ChannelHandlerContext.java
diff --git a/src/main/java/io/netty/channel/ChannelHandlerLifeCycleException.java b/transport/src/main/java/io/netty/channel/ChannelHandlerLifeCycleException.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelHandlerLifeCycleException.java
rename to transport/src/main/java/io/netty/channel/ChannelHandlerLifeCycleException.java
diff --git a/src/main/java/io/netty/channel/ChannelLocal.java b/transport/src/main/java/io/netty/channel/ChannelLocal.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelLocal.java
rename to transport/src/main/java/io/netty/channel/ChannelLocal.java
diff --git a/src/main/java/io/netty/channel/ChannelPipeline.java b/transport/src/main/java/io/netty/channel/ChannelPipeline.java
similarity index 97%
rename from src/main/java/io/netty/channel/ChannelPipeline.java
rename to transport/src/main/java/io/netty/channel/ChannelPipeline.java
index 6a222a7a10..f2162d7565 100644
--- a/src/main/java/io/netty/channel/ChannelPipeline.java
+++ b/transport/src/main/java/io/netty/channel/ChannelPipeline.java
@@ -22,9 +22,6 @@ import java.util.Map;
import java.util.NoSuchElementException;
import io.netty.buffer.ChannelBuffer;
-import io.netty.handler.execution.ExecutionHandler;
-import io.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor;
-import io.netty.handler.ssl.SslHandler;
/**
@@ -157,7 +154,7 @@ import io.netty.handler.ssl.SslHandler;
*
Protocol Decoder - translates binary data (e.g. {@link ChannelBuffer})
* into a Java object.
* Protocol Encoder - translates a Java object into binary data.
- * {@link ExecutionHandler} - applies a thread model.
+ * ExecutionHandler - applies a thread model.
* Business Logic Handler - performs the actual business logic
* (e.g. database access).
*
@@ -168,15 +165,15 @@ import io.netty.handler.ssl.SslHandler;
* {@link ChannelPipeline} pipeline = {@link Channels#pipeline() Channels.pipeline()};
* pipeline.addLast("decoder", new MyProtocolDecoder());
* pipeline.addLast("encoder", new MyProtocolEncoder());
- * pipeline.addLast("executor", new {@link ExecutionHandler}(new {@link OrderedMemoryAwareThreadPoolExecutor}(16, 1048576, 1048576)));
+ * pipeline.addLast("executor", new ExecutionHandler(...));
* pipeline.addLast("handler", new MyBusinessLogicHandler());
*
*
* Thread safety
*
* A {@link ChannelHandler} can be added or removed at any time because a
- * {@link ChannelPipeline} is thread safe. For example, you can insert a
- * {@link SslHandler} when sensitive information is about to be exchanged,
+ * {@link ChannelPipeline} is thread safe. For example, you can insert an
+ * encryption handler when sensitive information is about to be exchanged,
* and remove it after the exchange.
*
*
Pitfall
diff --git a/src/main/java/io/netty/channel/ChannelPipelineException.java b/transport/src/main/java/io/netty/channel/ChannelPipelineException.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelPipelineException.java
rename to transport/src/main/java/io/netty/channel/ChannelPipelineException.java
diff --git a/src/main/java/io/netty/channel/ChannelPipelineFactory.java b/transport/src/main/java/io/netty/channel/ChannelPipelineFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelPipelineFactory.java
rename to transport/src/main/java/io/netty/channel/ChannelPipelineFactory.java
diff --git a/src/main/java/io/netty/channel/ChannelSink.java b/transport/src/main/java/io/netty/channel/ChannelSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelSink.java
rename to transport/src/main/java/io/netty/channel/ChannelSink.java
diff --git a/src/main/java/io/netty/channel/ChannelState.java b/transport/src/main/java/io/netty/channel/ChannelState.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelState.java
rename to transport/src/main/java/io/netty/channel/ChannelState.java
diff --git a/src/main/java/io/netty/channel/ChannelStateEvent.java b/transport/src/main/java/io/netty/channel/ChannelStateEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChannelStateEvent.java
rename to transport/src/main/java/io/netty/channel/ChannelStateEvent.java
diff --git a/src/main/java/io/netty/channel/ChannelUpstreamHandler.java b/transport/src/main/java/io/netty/channel/ChannelUpstreamHandler.java
similarity index 90%
rename from src/main/java/io/netty/channel/ChannelUpstreamHandler.java
rename to transport/src/main/java/io/netty/channel/ChannelUpstreamHandler.java
index a17fe80be7..5203e44b19 100644
--- a/src/main/java/io/netty/channel/ChannelUpstreamHandler.java
+++ b/transport/src/main/java/io/netty/channel/ChannelUpstreamHandler.java
@@ -15,11 +15,6 @@
*/
package io.netty.channel;
-import java.util.concurrent.Executor;
-
-import io.netty.handler.execution.ExecutionHandler;
-
-
/**
* Handles or intercepts an upstream {@link ChannelEvent}, and sends a
* {@link ChannelEvent} to the next handler in a {@link ChannelPipeline}.
@@ -78,11 +73,7 @@ import io.netty.handler.execution.ExecutionHandler;
* {@link Channel}; the I/O thread of some transport can serve more than one
* {@link Channel} (e.g. NIO transport), while the I/O thread of other
* transports can serve only one (e.g. OIO transport).
- *
- * However, if you add an {@link ExecutionHandler} to a {@link ChannelPipeline},
- * this behavior changes depending on what {@link Executor} was employed to
- * dispatch the events. Please refer to {@link ExecutionHandler} for more
- * information.
+ *
* @apiviz.exclude ^io\.netty\.handler\..*$
*/
public interface ChannelUpstreamHandler extends ChannelHandler {
diff --git a/src/main/java/io/netty/channel/Channels.java b/transport/src/main/java/io/netty/channel/Channels.java
similarity index 100%
rename from src/main/java/io/netty/channel/Channels.java
rename to transport/src/main/java/io/netty/channel/Channels.java
diff --git a/src/main/java/io/netty/channel/ChildChannelStateEvent.java b/transport/src/main/java/io/netty/channel/ChildChannelStateEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/ChildChannelStateEvent.java
rename to transport/src/main/java/io/netty/channel/ChildChannelStateEvent.java
diff --git a/src/main/java/io/netty/channel/CompleteChannelFuture.java b/transport/src/main/java/io/netty/channel/CompleteChannelFuture.java
similarity index 100%
rename from src/main/java/io/netty/channel/CompleteChannelFuture.java
rename to transport/src/main/java/io/netty/channel/CompleteChannelFuture.java
diff --git a/src/main/java/io/netty/channel/DefaultChannelConfig.java b/transport/src/main/java/io/netty/channel/DefaultChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/DefaultChannelConfig.java
rename to transport/src/main/java/io/netty/channel/DefaultChannelConfig.java
diff --git a/src/main/java/io/netty/channel/DefaultChannelFuture.java b/transport/src/main/java/io/netty/channel/DefaultChannelFuture.java
similarity index 100%
rename from src/main/java/io/netty/channel/DefaultChannelFuture.java
rename to transport/src/main/java/io/netty/channel/DefaultChannelFuture.java
diff --git a/src/main/java/io/netty/channel/DefaultChannelPipeline.java b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java
similarity index 100%
rename from src/main/java/io/netty/channel/DefaultChannelPipeline.java
rename to transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java
diff --git a/src/main/java/io/netty/channel/DefaultChildChannelStateEvent.java b/transport/src/main/java/io/netty/channel/DefaultChildChannelStateEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/DefaultChildChannelStateEvent.java
rename to transport/src/main/java/io/netty/channel/DefaultChildChannelStateEvent.java
diff --git a/src/main/java/io/netty/channel/DefaultExceptionEvent.java b/transport/src/main/java/io/netty/channel/DefaultExceptionEvent.java
similarity index 94%
rename from src/main/java/io/netty/channel/DefaultExceptionEvent.java
rename to transport/src/main/java/io/netty/channel/DefaultExceptionEvent.java
index d18383b14a..d77abab7c7 100644
--- a/src/main/java/io/netty/channel/DefaultExceptionEvent.java
+++ b/transport/src/main/java/io/netty/channel/DefaultExceptionEvent.java
@@ -17,8 +17,6 @@ package io.netty.channel;
import static io.netty.channel.Channels.*;
-import io.netty.util.internal.StackTraceSimplifier;
-
/**
* The default {@link ExceptionEvent} implementation.
*/
@@ -39,7 +37,6 @@ public class DefaultExceptionEvent implements ExceptionEvent {
}
this.channel = channel;
this.cause = cause;
- StackTraceSimplifier.simplify(cause);
}
@Override
diff --git a/src/main/java/io/netty/channel/DefaultFileRegion.java b/transport/src/main/java/io/netty/channel/DefaultFileRegion.java
similarity index 100%
rename from src/main/java/io/netty/channel/DefaultFileRegion.java
rename to transport/src/main/java/io/netty/channel/DefaultFileRegion.java
diff --git a/src/main/java/io/netty/channel/DefaultServerChannelConfig.java b/transport/src/main/java/io/netty/channel/DefaultServerChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/DefaultServerChannelConfig.java
rename to transport/src/main/java/io/netty/channel/DefaultServerChannelConfig.java
diff --git a/src/main/java/io/netty/channel/DefaultWriteCompletionEvent.java b/transport/src/main/java/io/netty/channel/DefaultWriteCompletionEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/DefaultWriteCompletionEvent.java
rename to transport/src/main/java/io/netty/channel/DefaultWriteCompletionEvent.java
diff --git a/src/main/java/io/netty/channel/DownstreamChannelStateEvent.java b/transport/src/main/java/io/netty/channel/DownstreamChannelStateEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/DownstreamChannelStateEvent.java
rename to transport/src/main/java/io/netty/channel/DownstreamChannelStateEvent.java
diff --git a/src/main/java/io/netty/channel/DownstreamMessageEvent.java b/transport/src/main/java/io/netty/channel/DownstreamMessageEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/DownstreamMessageEvent.java
rename to transport/src/main/java/io/netty/channel/DownstreamMessageEvent.java
diff --git a/src/main/java/io/netty/channel/ExceptionEvent.java b/transport/src/main/java/io/netty/channel/ExceptionEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/ExceptionEvent.java
rename to transport/src/main/java/io/netty/channel/ExceptionEvent.java
diff --git a/src/main/java/io/netty/channel/FailedChannelFuture.java b/transport/src/main/java/io/netty/channel/FailedChannelFuture.java
similarity index 100%
rename from src/main/java/io/netty/channel/FailedChannelFuture.java
rename to transport/src/main/java/io/netty/channel/FailedChannelFuture.java
diff --git a/src/main/java/io/netty/channel/FileRegion.java b/transport/src/main/java/io/netty/channel/FileRegion.java
similarity index 100%
rename from src/main/java/io/netty/channel/FileRegion.java
rename to transport/src/main/java/io/netty/channel/FileRegion.java
diff --git a/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictor.java b/transport/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictor.java
similarity index 100%
rename from src/main/java/io/netty/channel/FixedReceiveBufferSizePredictor.java
rename to transport/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictor.java
diff --git a/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictorFactory.java b/transport/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictorFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/FixedReceiveBufferSizePredictorFactory.java
rename to transport/src/main/java/io/netty/channel/FixedReceiveBufferSizePredictorFactory.java
diff --git a/src/main/java/io/netty/channel/LifeCycleAwareChannelHandler.java b/transport/src/main/java/io/netty/channel/LifeCycleAwareChannelHandler.java
similarity index 100%
rename from src/main/java/io/netty/channel/LifeCycleAwareChannelHandler.java
rename to transport/src/main/java/io/netty/channel/LifeCycleAwareChannelHandler.java
diff --git a/src/main/java/io/netty/channel/MessageEvent.java b/transport/src/main/java/io/netty/channel/MessageEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/MessageEvent.java
rename to transport/src/main/java/io/netty/channel/MessageEvent.java
diff --git a/src/main/java/io/netty/channel/ReceiveBufferSizePredictor.java b/transport/src/main/java/io/netty/channel/ReceiveBufferSizePredictor.java
similarity index 100%
rename from src/main/java/io/netty/channel/ReceiveBufferSizePredictor.java
rename to transport/src/main/java/io/netty/channel/ReceiveBufferSizePredictor.java
diff --git a/src/main/java/io/netty/channel/ReceiveBufferSizePredictorFactory.java b/transport/src/main/java/io/netty/channel/ReceiveBufferSizePredictorFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/ReceiveBufferSizePredictorFactory.java
rename to transport/src/main/java/io/netty/channel/ReceiveBufferSizePredictorFactory.java
diff --git a/src/main/java/io/netty/channel/ServerChannel.java b/transport/src/main/java/io/netty/channel/ServerChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/ServerChannel.java
rename to transport/src/main/java/io/netty/channel/ServerChannel.java
diff --git a/src/main/java/io/netty/channel/ServerChannelFactory.java b/transport/src/main/java/io/netty/channel/ServerChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/ServerChannelFactory.java
rename to transport/src/main/java/io/netty/channel/ServerChannelFactory.java
diff --git a/src/main/java/io/netty/channel/SimpleChannelDownstreamHandler.java b/transport/src/main/java/io/netty/channel/SimpleChannelDownstreamHandler.java
similarity index 100%
rename from src/main/java/io/netty/channel/SimpleChannelDownstreamHandler.java
rename to transport/src/main/java/io/netty/channel/SimpleChannelDownstreamHandler.java
diff --git a/src/main/java/io/netty/channel/SimpleChannelHandler.java b/transport/src/main/java/io/netty/channel/SimpleChannelHandler.java
similarity index 100%
rename from src/main/java/io/netty/channel/SimpleChannelHandler.java
rename to transport/src/main/java/io/netty/channel/SimpleChannelHandler.java
diff --git a/src/main/java/io/netty/channel/SimpleChannelUpstreamHandler.java b/transport/src/main/java/io/netty/channel/SimpleChannelUpstreamHandler.java
similarity index 100%
rename from src/main/java/io/netty/channel/SimpleChannelUpstreamHandler.java
rename to transport/src/main/java/io/netty/channel/SimpleChannelUpstreamHandler.java
diff --git a/src/main/java/io/netty/channel/StaticChannelPipeline.java b/transport/src/main/java/io/netty/channel/StaticChannelPipeline.java
similarity index 100%
rename from src/main/java/io/netty/channel/StaticChannelPipeline.java
rename to transport/src/main/java/io/netty/channel/StaticChannelPipeline.java
diff --git a/src/main/java/io/netty/channel/SucceededChannelFuture.java b/transport/src/main/java/io/netty/channel/SucceededChannelFuture.java
similarity index 100%
rename from src/main/java/io/netty/channel/SucceededChannelFuture.java
rename to transport/src/main/java/io/netty/channel/SucceededChannelFuture.java
diff --git a/src/main/java/io/netty/channel/UpstreamChannelStateEvent.java b/transport/src/main/java/io/netty/channel/UpstreamChannelStateEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/UpstreamChannelStateEvent.java
rename to transport/src/main/java/io/netty/channel/UpstreamChannelStateEvent.java
diff --git a/src/main/java/io/netty/channel/UpstreamMessageEvent.java b/transport/src/main/java/io/netty/channel/UpstreamMessageEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/UpstreamMessageEvent.java
rename to transport/src/main/java/io/netty/channel/UpstreamMessageEvent.java
diff --git a/src/main/java/io/netty/channel/WriteCompletionEvent.java b/transport/src/main/java/io/netty/channel/WriteCompletionEvent.java
similarity index 100%
rename from src/main/java/io/netty/channel/WriteCompletionEvent.java
rename to transport/src/main/java/io/netty/channel/WriteCompletionEvent.java
diff --git a/src/main/java/io/netty/channel/group/ChannelGroup.java b/transport/src/main/java/io/netty/channel/group/ChannelGroup.java
similarity index 100%
rename from src/main/java/io/netty/channel/group/ChannelGroup.java
rename to transport/src/main/java/io/netty/channel/group/ChannelGroup.java
diff --git a/src/main/java/io/netty/channel/group/ChannelGroupFuture.java b/transport/src/main/java/io/netty/channel/group/ChannelGroupFuture.java
similarity index 98%
rename from src/main/java/io/netty/channel/group/ChannelGroupFuture.java
rename to transport/src/main/java/io/netty/channel/group/ChannelGroupFuture.java
index c6c8480b96..dae55eaa05 100644
--- a/src/main/java/io/netty/channel/group/ChannelGroupFuture.java
+++ b/transport/src/main/java/io/netty/channel/group/ChannelGroupFuture.java
@@ -24,7 +24,6 @@ import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.MessageEvent;
-import io.netty.handler.execution.ExecutionHandler;
/**
* The result of an asynchronous {@link ChannelGroup} operation.
@@ -69,8 +68,7 @@ import io.netty.handler.execution.ExecutionHandler;
*
Do not call {@link #await()} inside {@link ChannelHandler}
*
* The event handler methods in {@link ChannelHandler} is often called by
- * an I/O thread unless an {@link ExecutionHandler} is in the
- * {@link ChannelPipeline}. If {@link #await()} is called by an event handler
+ * an I/O thread. If {@link #await()} is called by an event handler
* method, which is called by the I/O thread, the I/O operation it is waiting
* for might never be complete because {@link #await()} can block the I/O
* operation it is waiting for, which is a dead lock.
@@ -107,6 +105,7 @@ import io.netty.handler.execution.ExecutionHandler;
* where it is more convenient to call {@link #await()}. In such a case, please
* make sure you do not call {@link #await()} in an I/O thread. Otherwise,
* {@link IllegalStateException} will be raised to prevent a dead lock.
+ *
* @apiviz.owns io.netty.channel.group.ChannelGroupFutureListener - - notifies
*/
public interface ChannelGroupFuture extends Iterable {
diff --git a/src/main/java/io/netty/channel/group/ChannelGroupFutureListener.java b/transport/src/main/java/io/netty/channel/group/ChannelGroupFutureListener.java
similarity index 100%
rename from src/main/java/io/netty/channel/group/ChannelGroupFutureListener.java
rename to transport/src/main/java/io/netty/channel/group/ChannelGroupFutureListener.java
diff --git a/src/main/java/io/netty/channel/group/CombinedIterator.java b/transport/src/main/java/io/netty/channel/group/CombinedIterator.java
similarity index 100%
rename from src/main/java/io/netty/channel/group/CombinedIterator.java
rename to transport/src/main/java/io/netty/channel/group/CombinedIterator.java
diff --git a/src/main/java/io/netty/channel/group/DefaultChannelGroup.java b/transport/src/main/java/io/netty/channel/group/DefaultChannelGroup.java
similarity index 100%
rename from src/main/java/io/netty/channel/group/DefaultChannelGroup.java
rename to transport/src/main/java/io/netty/channel/group/DefaultChannelGroup.java
diff --git a/src/main/java/io/netty/channel/group/DefaultChannelGroupFuture.java b/transport/src/main/java/io/netty/channel/group/DefaultChannelGroupFuture.java
similarity index 100%
rename from src/main/java/io/netty/channel/group/DefaultChannelGroupFuture.java
rename to transport/src/main/java/io/netty/channel/group/DefaultChannelGroupFuture.java
diff --git a/src/main/java/io/netty/channel/group/package-info.java b/transport/src/main/java/io/netty/channel/group/package-info.java
similarity index 100%
rename from src/main/java/io/netty/channel/group/package-info.java
rename to transport/src/main/java/io/netty/channel/group/package-info.java
diff --git a/src/main/java/io/netty/channel/iostream/IOStreamAddress.java b/transport/src/main/java/io/netty/channel/iostream/IOStreamAddress.java
similarity index 100%
rename from src/main/java/io/netty/channel/iostream/IOStreamAddress.java
rename to transport/src/main/java/io/netty/channel/iostream/IOStreamAddress.java
diff --git a/src/main/java/io/netty/channel/iostream/IOStreamChannel.java b/transport/src/main/java/io/netty/channel/iostream/IOStreamChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/iostream/IOStreamChannel.java
rename to transport/src/main/java/io/netty/channel/iostream/IOStreamChannel.java
diff --git a/src/main/java/io/netty/channel/iostream/IOStreamChannelFactory.java b/transport/src/main/java/io/netty/channel/iostream/IOStreamChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/iostream/IOStreamChannelFactory.java
rename to transport/src/main/java/io/netty/channel/iostream/IOStreamChannelFactory.java
diff --git a/src/main/java/io/netty/channel/iostream/IOStreamChannelSink.java b/transport/src/main/java/io/netty/channel/iostream/IOStreamChannelSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/iostream/IOStreamChannelSink.java
rename to transport/src/main/java/io/netty/channel/iostream/IOStreamChannelSink.java
diff --git a/src/main/java/io/netty/channel/local/DefaultLocalChannel.java b/transport/src/main/java/io/netty/channel/local/DefaultLocalChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/DefaultLocalChannel.java
rename to transport/src/main/java/io/netty/channel/local/DefaultLocalChannel.java
diff --git a/src/main/java/io/netty/channel/local/DefaultLocalClientChannelFactory.java b/transport/src/main/java/io/netty/channel/local/DefaultLocalClientChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/DefaultLocalClientChannelFactory.java
rename to transport/src/main/java/io/netty/channel/local/DefaultLocalClientChannelFactory.java
diff --git a/src/main/java/io/netty/channel/local/DefaultLocalServerChannel.java b/transport/src/main/java/io/netty/channel/local/DefaultLocalServerChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/DefaultLocalServerChannel.java
rename to transport/src/main/java/io/netty/channel/local/DefaultLocalServerChannel.java
diff --git a/src/main/java/io/netty/channel/local/DefaultLocalServerChannelFactory.java b/transport/src/main/java/io/netty/channel/local/DefaultLocalServerChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/DefaultLocalServerChannelFactory.java
rename to transport/src/main/java/io/netty/channel/local/DefaultLocalServerChannelFactory.java
diff --git a/src/main/java/io/netty/channel/local/LocalAddress.java b/transport/src/main/java/io/netty/channel/local/LocalAddress.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/LocalAddress.java
rename to transport/src/main/java/io/netty/channel/local/LocalAddress.java
diff --git a/src/main/java/io/netty/channel/local/LocalChannel.java b/transport/src/main/java/io/netty/channel/local/LocalChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/LocalChannel.java
rename to transport/src/main/java/io/netty/channel/local/LocalChannel.java
diff --git a/src/main/java/io/netty/channel/local/LocalChannelRegistry.java b/transport/src/main/java/io/netty/channel/local/LocalChannelRegistry.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/LocalChannelRegistry.java
rename to transport/src/main/java/io/netty/channel/local/LocalChannelRegistry.java
diff --git a/src/main/java/io/netty/channel/local/LocalClientChannelFactory.java b/transport/src/main/java/io/netty/channel/local/LocalClientChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/LocalClientChannelFactory.java
rename to transport/src/main/java/io/netty/channel/local/LocalClientChannelFactory.java
diff --git a/src/main/java/io/netty/channel/local/LocalClientChannelSink.java b/transport/src/main/java/io/netty/channel/local/LocalClientChannelSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/LocalClientChannelSink.java
rename to transport/src/main/java/io/netty/channel/local/LocalClientChannelSink.java
diff --git a/src/main/java/io/netty/channel/local/LocalServerChannel.java b/transport/src/main/java/io/netty/channel/local/LocalServerChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/LocalServerChannel.java
rename to transport/src/main/java/io/netty/channel/local/LocalServerChannel.java
diff --git a/src/main/java/io/netty/channel/local/LocalServerChannelFactory.java b/transport/src/main/java/io/netty/channel/local/LocalServerChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/LocalServerChannelFactory.java
rename to transport/src/main/java/io/netty/channel/local/LocalServerChannelFactory.java
diff --git a/src/main/java/io/netty/channel/local/LocalServerChannelSink.java b/transport/src/main/java/io/netty/channel/local/LocalServerChannelSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/LocalServerChannelSink.java
rename to transport/src/main/java/io/netty/channel/local/LocalServerChannelSink.java
diff --git a/src/main/java/io/netty/channel/local/package-info.java b/transport/src/main/java/io/netty/channel/local/package-info.java
similarity index 100%
rename from src/main/java/io/netty/channel/local/package-info.java
rename to transport/src/main/java/io/netty/channel/local/package-info.java
diff --git a/src/main/java/io/netty/channel/package-info.java b/transport/src/main/java/io/netty/channel/package-info.java
similarity index 100%
rename from src/main/java/io/netty/channel/package-info.java
rename to transport/src/main/java/io/netty/channel/package-info.java
diff --git a/src/main/java/io/netty/channel/socket/ClientSocketChannelFactory.java b/transport/src/main/java/io/netty/channel/socket/ClientSocketChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/ClientSocketChannelFactory.java
rename to transport/src/main/java/io/netty/channel/socket/ClientSocketChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/DatagramChannel.java b/transport/src/main/java/io/netty/channel/socket/DatagramChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/DatagramChannel.java
rename to transport/src/main/java/io/netty/channel/socket/DatagramChannel.java
diff --git a/src/main/java/io/netty/channel/socket/DatagramChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/DatagramChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/DatagramChannelConfig.java
rename to transport/src/main/java/io/netty/channel/socket/DatagramChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/DatagramChannelFactory.java b/transport/src/main/java/io/netty/channel/socket/DatagramChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/DatagramChannelFactory.java
rename to transport/src/main/java/io/netty/channel/socket/DatagramChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java
rename to transport/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/DefaultServerSocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/DefaultServerSocketChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/DefaultServerSocketChannelConfig.java
rename to transport/src/main/java/io/netty/channel/socket/DefaultServerSocketChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/DefaultSocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/DefaultSocketChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/DefaultSocketChannelConfig.java
rename to transport/src/main/java/io/netty/channel/socket/DefaultSocketChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/ServerSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/ServerSocketChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/ServerSocketChannel.java
rename to transport/src/main/java/io/netty/channel/socket/ServerSocketChannel.java
diff --git a/src/main/java/io/netty/channel/socket/ServerSocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/ServerSocketChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/ServerSocketChannelConfig.java
rename to transport/src/main/java/io/netty/channel/socket/ServerSocketChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/ServerSocketChannelFactory.java b/transport/src/main/java/io/netty/channel/socket/ServerSocketChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/ServerSocketChannelFactory.java
rename to transport/src/main/java/io/netty/channel/socket/ServerSocketChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/SocketChannel.java b/transport/src/main/java/io/netty/channel/socket/SocketChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/SocketChannel.java
rename to transport/src/main/java/io/netty/channel/socket/SocketChannel.java
diff --git a/src/main/java/io/netty/channel/socket/SocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/SocketChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/SocketChannelConfig.java
rename to transport/src/main/java/io/netty/channel/socket/SocketChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/nio/AbstractWriteRequestQueue.java b/transport/src/main/java/io/netty/channel/socket/nio/AbstractWriteRequestQueue.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/AbstractWriteRequestQueue.java
rename to transport/src/main/java/io/netty/channel/socket/nio/AbstractWriteRequestQueue.java
diff --git a/src/main/java/io/netty/channel/socket/nio/DefaultNioDatagramChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/nio/DefaultNioDatagramChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/DefaultNioDatagramChannelConfig.java
rename to transport/src/main/java/io/netty/channel/socket/nio/DefaultNioDatagramChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/nio/DefaultNioSocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/nio/DefaultNioSocketChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/DefaultNioSocketChannelConfig.java
rename to transport/src/main/java/io/netty/channel/socket/nio/DefaultNioSocketChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioAcceptedSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/nio/NioAcceptedSocketChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioAcceptedSocketChannel.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioAcceptedSocketChannel.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioClientSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/nio/NioClientSocketChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioClientSocketChannel.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioClientSocketChannel.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioClientSocketChannelFactory.java b/transport/src/main/java/io/netty/channel/socket/nio/NioClientSocketChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioClientSocketChannelFactory.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioClientSocketChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioClientSocketPipelineSink.java b/transport/src/main/java/io/netty/channel/socket/nio/NioClientSocketPipelineSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioClientSocketPipelineSink.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioClientSocketPipelineSink.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioDatagramChannel.java b/transport/src/main/java/io/netty/channel/socket/nio/NioDatagramChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioDatagramChannel.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioDatagramChannel.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioDatagramChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/nio/NioDatagramChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioDatagramChannelConfig.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioDatagramChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioDatagramChannelFactory.java b/transport/src/main/java/io/netty/channel/socket/nio/NioDatagramChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioDatagramChannelFactory.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioDatagramChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioDatagramPipelineSink.java b/transport/src/main/java/io/netty/channel/socket/nio/NioDatagramPipelineSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioDatagramPipelineSink.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioDatagramPipelineSink.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioDatagramWorker.java b/transport/src/main/java/io/netty/channel/socket/nio/NioDatagramWorker.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioDatagramWorker.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioDatagramWorker.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioProviderMetadata.java b/transport/src/main/java/io/netty/channel/socket/nio/NioProviderMetadata.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioProviderMetadata.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioProviderMetadata.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioServerSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/nio/NioServerSocketChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioServerSocketChannel.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioServerSocketChannel.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioServerSocketChannelFactory.java b/transport/src/main/java/io/netty/channel/socket/nio/NioServerSocketChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioServerSocketChannelFactory.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioServerSocketChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioServerSocketPipelineSink.java b/transport/src/main/java/io/netty/channel/socket/nio/NioServerSocketPipelineSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioServerSocketPipelineSink.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioServerSocketPipelineSink.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/nio/NioSocketChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioSocketChannel.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioSocketChannel.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioSocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/nio/NioSocketChannelConfig.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioSocketChannelConfig.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioSocketChannelConfig.java
diff --git a/src/main/java/io/netty/channel/socket/nio/NioWorker.java b/transport/src/main/java/io/netty/channel/socket/nio/NioWorker.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/NioWorker.java
rename to transport/src/main/java/io/netty/channel/socket/nio/NioWorker.java
diff --git a/src/main/java/io/netty/channel/socket/nio/SelectorUtil.java b/transport/src/main/java/io/netty/channel/socket/nio/SelectorUtil.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/SelectorUtil.java
rename to transport/src/main/java/io/netty/channel/socket/nio/SelectorUtil.java
diff --git a/src/main/java/io/netty/channel/socket/nio/SocketReceiveBufferPool.java b/transport/src/main/java/io/netty/channel/socket/nio/SocketReceiveBufferPool.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/SocketReceiveBufferPool.java
rename to transport/src/main/java/io/netty/channel/socket/nio/SocketReceiveBufferPool.java
diff --git a/src/main/java/io/netty/channel/socket/nio/SocketSendBufferPool.java b/transport/src/main/java/io/netty/channel/socket/nio/SocketSendBufferPool.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/SocketSendBufferPool.java
rename to transport/src/main/java/io/netty/channel/socket/nio/SocketSendBufferPool.java
diff --git a/src/main/java/io/netty/channel/socket/nio/package-info.java b/transport/src/main/java/io/netty/channel/socket/nio/package-info.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/nio/package-info.java
rename to transport/src/main/java/io/netty/channel/socket/nio/package-info.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioAcceptedSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/oio/OioAcceptedSocketChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioAcceptedSocketChannel.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioAcceptedSocketChannel.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioClientSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/oio/OioClientSocketChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioClientSocketChannel.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioClientSocketChannel.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioClientSocketChannelFactory.java b/transport/src/main/java/io/netty/channel/socket/oio/OioClientSocketChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioClientSocketChannelFactory.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioClientSocketChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioClientSocketPipelineSink.java b/transport/src/main/java/io/netty/channel/socket/oio/OioClientSocketPipelineSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioClientSocketPipelineSink.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioClientSocketPipelineSink.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioDatagramChannel.java b/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioDatagramChannel.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannel.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioDatagramChannelFactory.java b/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioDatagramChannelFactory.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioDatagramPipelineSink.java b/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramPipelineSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioDatagramPipelineSink.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioDatagramPipelineSink.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioDatagramWorker.java b/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramWorker.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioDatagramWorker.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioDatagramWorker.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioServerSocketChannel.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannel.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannelFactory.java b/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannelFactory.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioServerSocketChannelFactory.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannelFactory.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioServerSocketPipelineSink.java b/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketPipelineSink.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioServerSocketPipelineSink.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketPipelineSink.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/oio/OioSocketChannel.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioSocketChannel.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioSocketChannel.java
diff --git a/src/main/java/io/netty/channel/socket/oio/OioWorker.java b/transport/src/main/java/io/netty/channel/socket/oio/OioWorker.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/OioWorker.java
rename to transport/src/main/java/io/netty/channel/socket/oio/OioWorker.java
diff --git a/src/main/java/io/netty/channel/socket/oio/package-info.java b/transport/src/main/java/io/netty/channel/socket/oio/package-info.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/oio/package-info.java
rename to transport/src/main/java/io/netty/channel/socket/oio/package-info.java
diff --git a/src/main/java/io/netty/channel/socket/package-info.java b/transport/src/main/java/io/netty/channel/socket/package-info.java
similarity index 100%
rename from src/main/java/io/netty/channel/socket/package-info.java
rename to transport/src/main/java/io/netty/channel/socket/package-info.java
diff --git a/src/test/java/io/netty/bootstrap/BootstrapOrderedMapTest.java b/transport/src/test/java/io/netty/bootstrap/BootstrapOrderedMapTest.java
similarity index 100%
rename from src/test/java/io/netty/bootstrap/BootstrapOrderedMapTest.java
rename to transport/src/test/java/io/netty/bootstrap/BootstrapOrderedMapTest.java
diff --git a/src/test/java/io/netty/bootstrap/BootstrapTest.java b/transport/src/test/java/io/netty/bootstrap/BootstrapTest.java
similarity index 94%
rename from src/test/java/io/netty/bootstrap/BootstrapTest.java
rename to transport/src/test/java/io/netty/bootstrap/BootstrapTest.java
index 5255be1ddf..fdf24488c7 100644
--- a/src/test/java/io/netty/bootstrap/BootstrapTest.java
+++ b/transport/src/test/java/io/netty/bootstrap/BootstrapTest.java
@@ -25,11 +25,15 @@ import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Map.Entry;
+import io.netty.channel.ChannelDownstreamHandler;
+import io.netty.channel.ChannelEvent;
import io.netty.channel.ChannelFactory;
import io.netty.channel.ChannelHandler;
+import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ChannelPipelineFactory;
-import io.netty.util.DummyHandler;
+import io.netty.channel.ChannelUpstreamHandler;
+
import org.junit.Test;
@@ -338,4 +342,18 @@ public class BootstrapTest {
public void shouldNotAllowNullOptionMap() {
new Bootstrap().setOptions(null);
}
+
+ private class DummyHandler implements ChannelUpstreamHandler, ChannelDownstreamHandler {
+
+ public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e)
+ throws Exception {
+ ctx.sendUpstream(e);
+ }
+
+ public void handleDownstream(ChannelHandlerContext ctx, ChannelEvent e)
+ throws Exception {
+ ctx.sendDownstream(e);
+ }
+ }
+
}
diff --git a/src/test/java/io/netty/channel/CompleteChannelFutureTest.java b/transport/src/test/java/io/netty/channel/CompleteChannelFutureTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/CompleteChannelFutureTest.java
rename to transport/src/test/java/io/netty/channel/CompleteChannelFutureTest.java
diff --git a/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java b/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/DefaultChannelPipelineTest.java
rename to transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java
diff --git a/src/test/java/io/netty/channel/FailedChannelFutureTest.java b/transport/src/test/java/io/netty/channel/FailedChannelFutureTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/FailedChannelFutureTest.java
rename to transport/src/test/java/io/netty/channel/FailedChannelFutureTest.java
diff --git a/src/test/java/io/netty/channel/StaticChannelPipelineTest.java b/transport/src/test/java/io/netty/channel/StaticChannelPipelineTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/StaticChannelPipelineTest.java
rename to transport/src/test/java/io/netty/channel/StaticChannelPipelineTest.java
diff --git a/src/test/java/io/netty/channel/SucceededChannelFutureTest.java b/transport/src/test/java/io/netty/channel/SucceededChannelFutureTest.java
similarity index 100%
rename from src/test/java/io/netty/channel/SucceededChannelFutureTest.java
rename to transport/src/test/java/io/netty/channel/SucceededChannelFutureTest.java