Skip to content

Commit

Permalink
Issue netty#60: Make the project multi-module
Browse files Browse the repository at this point in the history
Split the project into the following modules:
* common
* buffer
* codec
* codec-http
* transport
* transport-*
* handler
* example
* testsuite (integration tests that involve 2+ modules)
* all (does nothing yet, but will make it generate netty.jar)

This commit also fixes the compilation errors with transport-sctp on
non-Linux systems.  It will at least compile without complaints.
  • Loading branch information
trustin committed Dec 28, 2011
1 parent 8ad4cd0 commit 8663716
Show file tree
Hide file tree
Showing 780 changed files with 2,052 additions and 2,155 deletions.
20 changes: 11 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/.project
/.classpath
/.settings
/target
.project
.classpath
.settings
*.iml
*.ipr
*.iws
.geany
*/target
*/target
/reports
/src/main/java/io/netty/util/Version.java
/*.iml
/*.ipr
/*.iws
/*.geany
*/reports

32 changes: 32 additions & 0 deletions all/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<artifactId>netty-parent</artifactId>
<version>4.0.0.Alpha1-SNAPSHOT</version>
</parent>

<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<packaging>jar</packaging>

<name>Netty/All-in-One</name>
</project>

40 changes: 40 additions & 0 deletions buffer/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<artifactId>netty-parent</artifactId>
<version>4.0.0.Alpha1-SNAPSHOT</version>
</parent>

<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<packaging>jar</packaging>

<name>Netty/Buffer</name>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-common</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

45 changes: 45 additions & 0 deletions codec-http/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<artifactId>netty-parent</artifactId>
<version>4.0.0.Alpha1-SNAPSHOT</version>
</parent>

<groupId>io.netty</groupId>
<artifactId>netty-codec-http</artifactId>
<packaging>jar</packaging>

<name>Netty/Codec/HTTP</name>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-codec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-handler</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

45 changes: 45 additions & 0 deletions codec/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<artifactId>netty-parent</artifactId>
<version>4.0.0.Alpha1-SNAPSHOT</version>
</parent>

<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<packaging>jar</packaging>

<name>Netty/Codec</name>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>

77 changes: 77 additions & 0 deletions common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<artifactId>netty-parent</artifactId>
<version>4.0.0.Alpha1-SNAPSHOT</version>
</parent>

<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<packaging>jar</packaging>

<name>Netty/Common</name>

<dependencies>
<!-- Logging frameworks - completely optional -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
</dependencies>

<build>
<plugins>
</plugins>
</build>
</project>

Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
package io.netty.logging;

import io.netty.util.internal.StackTraceSimplifier;

/**
* Creates an {@link InternalLogger} or changes the default factory
* implementation. This factory allows you to choose what logging framework
Expand All @@ -36,13 +34,6 @@
public abstract class InternalLoggerFactory {
private static volatile InternalLoggerFactory defaultFactory = new JdkLoggerFactory();

static {
// Load the dependent classes in advance to avoid the case where
// the VM fails to load the required classes because of too many open
// files.
StackTraceSimplifier.simplify(new Exception());
}

/**
* Returns the default factory. The initial default factory is
* {@link JdkLoggerFactory}.
Expand Down Expand Up @@ -82,7 +73,6 @@ public void debug(String msg) {

@Override
public void debug(String msg, Throwable cause) {
StackTraceSimplifier.simplify(cause);
logger.debug(msg, cause);
}

Expand All @@ -93,7 +83,6 @@ public void error(String msg) {

@Override
public void error(String msg, Throwable cause) {
StackTraceSimplifier.simplify(cause);
logger.error(msg, cause);
}

Expand All @@ -104,7 +93,6 @@ public void info(String msg) {

@Override
public void info(String msg, Throwable cause) {
StackTraceSimplifier.simplify(cause);
logger.info(msg, cause);
}

Expand Down Expand Up @@ -135,7 +123,6 @@ public void warn(String msg) {

@Override
public void warn(String msg, Throwable cause) {
StackTraceSimplifier.simplify(cause);
logger.warn(msg, cause);
}

Expand All @@ -151,7 +138,6 @@ public void log(InternalLogLevel level, String msg) {

@Override
public void log(InternalLogLevel level, String msg, Throwable cause) {
StackTraceSimplifier.simplify(cause);
logger.log(level, msg, cause);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

import io.netty.channel.ChannelPipelineFactory;
import io.netty.logging.InternalLogger;
import io.netty.logging.InternalLoggerFactory;
import io.netty.util.internal.ConcurrentIdentityHashMap;
Expand Down Expand Up @@ -64,9 +63,7 @@
* {@link HashedWheelTimer} creates a new thread whenever it is instantiated and
* started. Therefore, you should make sure to create only one instance and
* share it across your application. One of the common mistakes, that makes
* your application unresponsive, is to create a new instance in
* {@link ChannelPipelineFactory}, which results in the creation of a new thread
* for every connection.
* your application unresponsive, is to create a new instance for every connection.
*
* <h3>Implementation Details</h3>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
import java.net.InetAddress;
import java.net.UnknownHostException;

public final class SocketAddresses {

/**
*/
@org.junit.Ignore
public final class TestUtil {

private static final InetAddress LOCALHOST;
public static final InetAddress LOCALHOST;

static {
// We cache this because some machine takes almost forever to return
// from InetAddress.getLocalHost(). I think it's due to the incorrect
// /etc/hosts or /etc/resolve.conf.
InetAddress localhost = null;
try {
localhost = InetAddress.getLocalHost();
Expand All @@ -46,14 +45,7 @@ public final class TestUtil {
LOCALHOST = localhost;
}

public static InetAddress getLocalHost() {
// We cache this because some machine takes almost forever to return
// from InetAddress.getLocalHost(). I think it's due to the incorrect
// /etc/hosts or /etc/resolve.conf.
return LOCALHOST;
}

private TestUtil() {
private SocketAddresses() {
// Unused
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8663716

Please sign in to comment.