Raise the Netty 5 minimum required Java version to Java 11. (#10650)
Raise the Netty 5 minimum required Java version to Java 11. Motivation: Java 11 has been out for some time, and Netty 5 is still some ways out. There are also many good features in Java 11 that we wish to use, such as VarHandles, var-keyword, and the module system. There is no reason for Netty 5 to not require Java 11, since Netty 4.x will still be supported for the time being. Modification: Remove everything in the pom files related to Java versions older than Java 11. Remove the animal-sniffer plug-in and rely on the `--release` compiler flag instead. Remove docker files related to Java versions older than Java 11. Remove the copied SCTP APIs -- we should test this commit independently on Windows. Remove the OpenJdkSelfSignedCertGenerator.java file and just always use Bouncy Castle for generating self-signed certificates for testing. Make netty-testsuite tests pass by including Bouncy Castle as a test dependency, so we're able to generate our self-signed certificate. Result: Java 11 is now the minimum required Java version.
This commit is contained in:
parent
2464bee521
commit
a179db8066
12
all/pom.xml
12
all/pom.xml
@ -704,18 +704,6 @@
|
|||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- Disable animal sniffer -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>default</id>
|
|
||||||
<phase>none</phase>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
|
|
||||||
<!-- Disable checkstyle -->
|
<!-- Disable checkstyle -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
|
@ -293,49 +293,6 @@
|
|||||||
<maxmem>1024m</maxmem>
|
<maxmem>1024m</maxmem>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<!-- ensure that only methods available in java 1.6 can
|
|
||||||
be used even when compiling with java 1.7+ -->
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
|
||||||
<version>1.15</version>
|
|
||||||
<configuration>
|
|
||||||
<signature>
|
|
||||||
<groupId>org.codehaus.mojo.signature</groupId>
|
|
||||||
<artifactId>java16</artifactId>
|
|
||||||
<version>1.1</version>
|
|
||||||
</signature>
|
|
||||||
<ignores>
|
|
||||||
<ignore>sun.misc.Unsafe</ignore>
|
|
||||||
<ignore>sun.misc.Cleaner</ignore>
|
|
||||||
|
|
||||||
<ignore>java.util.zip.Deflater</ignore>
|
|
||||||
|
|
||||||
<!-- Used for NIO UDP multicast -->
|
|
||||||
<ignore>java.nio.channels.DatagramChannel</ignore>
|
|
||||||
<ignore>java.nio.channels.MembershipKey</ignore>
|
|
||||||
<ignore>java.net.StandardProtocolFamily</ignore>
|
|
||||||
|
|
||||||
<!-- Used for NIO. 2 -->
|
|
||||||
<ignore>java.nio.channels.AsynchronousChannel</ignore>
|
|
||||||
<ignore>java.nio.channels.AsynchronousSocketChannel</ignore>
|
|
||||||
<ignore>java.nio.channels.AsynchronousServerSocketChannel</ignore>
|
|
||||||
<ignore>java.nio.channels.AsynchronousChannelGroup</ignore>
|
|
||||||
<ignore>java.nio.channels.NetworkChannel</ignore>
|
|
||||||
<ignore>java.nio.channels.InterruptedByTimeoutException</ignore>
|
|
||||||
<ignore>java.net.StandardSocketOptions</ignore>
|
|
||||||
<ignore>java.net.SocketOption</ignore>
|
|
||||||
</ignores>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>process-classes</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
<version>2.12.1</version>
|
<version>2.12.1</version>
|
||||||
|
@ -18,7 +18,7 @@ RUN yum install -y \
|
|||||||
tar \
|
tar \
|
||||||
wget
|
wget
|
||||||
|
|
||||||
ARG java_version=1.8
|
ARG java_version=11
|
||||||
ENV JAVA_VERSION $java_version
|
ENV JAVA_VERSION $java_version
|
||||||
# installing java with jabba
|
# installing java with jabba
|
||||||
RUN curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | JABBA_COMMAND="install $JAVA_VERSION -o /jdk" bash
|
RUN curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | JABBA_COMMAND="install $JAVA_VERSION -o /jdk" bash
|
||||||
|
@ -7,7 +7,7 @@ ENV GCC_VERSION $gcc_version
|
|||||||
RUN yum install -y wget tar git make redhat-lsb-core autoconf automake libtool glibc-devel libaio-devel openssl-devel apr-devel lksctp-tools
|
RUN yum install -y wget tar git make redhat-lsb-core autoconf automake libtool glibc-devel libaio-devel openssl-devel apr-devel lksctp-tools
|
||||||
|
|
||||||
# Install Java
|
# Install Java
|
||||||
RUN yum install -y java-1.8.0-openjdk-devel
|
RUN yum install -y java-11-openjdk-devel
|
||||||
|
|
||||||
# Install aarch64 gcc toolchain
|
# Install aarch64 gcc toolchain
|
||||||
RUN set -x && \
|
RUN set -x && \
|
||||||
@ -15,4 +15,4 @@ RUN set -x && \
|
|||||||
tar xvf gcc-linaro-$GCC_VERSION-x86_64_aarch64-linux-gnu.tar.xz
|
tar xvf gcc-linaro-$GCC_VERSION-x86_64_aarch64-linux-gnu.tar.xz
|
||||||
|
|
||||||
ENV PATH="/gcc-linaro-$GCC_VERSION-x86_64_aarch64-linux-gnu/bin:${PATH}"
|
ENV PATH="/gcc-linaro-$GCC_VERSION-x86_64_aarch64-linux-gnu/bin:${PATH}"
|
||||||
ENV JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk/"
|
ENV JAVA_HOME="/usr/lib/jvm/java-11-openjdk/"
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
cd /path/to/netty/
|
cd /path/to/netty/
|
||||||
```
|
```
|
||||||
|
|
||||||
## centos 6 with java 8
|
## centos 6 with java 11
|
||||||
|
|
||||||
```
|
```
|
||||||
docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.18.yaml run test
|
docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.centos-6.111.yaml run test
|
||||||
```
|
```
|
||||||
|
|
||||||
## centos 7 with java 11
|
## centos 7 with java 11
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
runtime-setup:
|
|
||||||
image: netty:centos-6-1.10
|
|
||||||
build:
|
|
||||||
args:
|
|
||||||
centos_version : "6"
|
|
||||||
java_version : "zulu@1.10.0-2"
|
|
||||||
|
|
||||||
test:
|
|
||||||
image: netty:centos-6-1.10
|
|
||||||
test-leak:
|
|
||||||
image: netty:centos-6-1.10
|
|
||||||
|
|
||||||
test-boringssl-static:
|
|
||||||
image: netty:centos-6-1.10
|
|
||||||
|
|
||||||
shell:
|
|
||||||
image: netty:centos-6-1.10
|
|
@ -1,22 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
runtime-setup:
|
|
||||||
image: netty:centos-6-1.8
|
|
||||||
build:
|
|
||||||
args:
|
|
||||||
centos_version : "6"
|
|
||||||
java_version : "adopt@1.8.0-252"
|
|
||||||
|
|
||||||
test:
|
|
||||||
image: netty:centos-6-1.8
|
|
||||||
|
|
||||||
test-leak:
|
|
||||||
image: netty:centos-6-1.8
|
|
||||||
|
|
||||||
test-boringssl-static:
|
|
||||||
image: netty:centos-6-1.8
|
|
||||||
|
|
||||||
shell:
|
|
||||||
image: netty:centos-6-1.8
|
|
@ -1,22 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
runtime-setup:
|
|
||||||
image: netty:centos-6-1.9
|
|
||||||
build:
|
|
||||||
args:
|
|
||||||
centos_version : "6"
|
|
||||||
java_version : "zulu@1.9.0-7"
|
|
||||||
|
|
||||||
test:
|
|
||||||
image: netty:centos-6-1.9
|
|
||||||
|
|
||||||
test-leak:
|
|
||||||
image: netty:centos-6-1.9
|
|
||||||
|
|
||||||
test-boringssl-static:
|
|
||||||
image: netty:centos-6-1.9
|
|
||||||
|
|
||||||
shell:
|
|
||||||
image: netty:centos-6-1.9
|
|
@ -1,22 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
runtime-setup:
|
|
||||||
image: netty:centos-6-1.8
|
|
||||||
build:
|
|
||||||
args:
|
|
||||||
centos_version : "6"
|
|
||||||
java_version : "graalvm-ce-java8@20.1.0"
|
|
||||||
|
|
||||||
test:
|
|
||||||
image: netty:centos-6-1.8
|
|
||||||
|
|
||||||
test-leak:
|
|
||||||
image: netty:centos-6-1.8
|
|
||||||
|
|
||||||
test-boringssl-static:
|
|
||||||
image: netty:centos-6-1.8
|
|
||||||
|
|
||||||
shell:
|
|
||||||
image: netty:centos-6-1.8
|
|
@ -1,22 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
runtime-setup:
|
|
||||||
image: netty:centos-7-1.10
|
|
||||||
build:
|
|
||||||
args:
|
|
||||||
centos_version : "7"
|
|
||||||
java_version : "zulu@1.10.0-2"
|
|
||||||
|
|
||||||
test:
|
|
||||||
image: netty:centos-7-1.10
|
|
||||||
|
|
||||||
test-leak:
|
|
||||||
image: netty:centos-7-1.10
|
|
||||||
|
|
||||||
test-boringssl-static:
|
|
||||||
image: netty:centos-7-1.10
|
|
||||||
|
|
||||||
shell:
|
|
||||||
image: netty:centos-7-1.10
|
|
@ -1,22 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
runtime-setup:
|
|
||||||
image: netty:centos-7-1.8
|
|
||||||
build:
|
|
||||||
args:
|
|
||||||
centos_version : "7"
|
|
||||||
java_version : "adopt@1.8.0-252"
|
|
||||||
|
|
||||||
test:
|
|
||||||
image: netty:centos-7-1.8
|
|
||||||
|
|
||||||
test-leak:
|
|
||||||
image: netty:centos-7-1.8
|
|
||||||
|
|
||||||
test-boringssl-static:
|
|
||||||
image: netty:centos-7-1.8
|
|
||||||
|
|
||||||
shell:
|
|
||||||
image: netty:centos-7-1.8
|
|
@ -1,22 +0,0 @@
|
|||||||
version: "3"
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
runtime-setup:
|
|
||||||
image: netty:centos-7-1.9
|
|
||||||
build:
|
|
||||||
args:
|
|
||||||
centos_version : "7"
|
|
||||||
java_version : "zulu@1.9.0-7"
|
|
||||||
|
|
||||||
test:
|
|
||||||
image: netty:centos-7-1.9
|
|
||||||
|
|
||||||
test-leak:
|
|
||||||
image: netty:centos-7-1.9
|
|
||||||
|
|
||||||
test-boringssl-static:
|
|
||||||
image: netty:centos-7-1.9
|
|
||||||
|
|
||||||
shell:
|
|
||||||
image: netty:centos-7-1.9
|
|
@ -76,6 +76,16 @@
|
|||||||
<groupId>org.mockito</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
<artifactId>mockito-core</artifactId>
|
<artifactId>mockito-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcpkix-jdk15on</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
@ -1,84 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2014 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.util;
|
|
||||||
|
|
||||||
import sun.security.x509.AlgorithmId;
|
|
||||||
import sun.security.x509.CertificateAlgorithmId;
|
|
||||||
import sun.security.x509.CertificateIssuerName;
|
|
||||||
import sun.security.x509.CertificateSerialNumber;
|
|
||||||
import sun.security.x509.CertificateSubjectName;
|
|
||||||
import sun.security.x509.CertificateValidity;
|
|
||||||
import sun.security.x509.CertificateVersion;
|
|
||||||
import sun.security.x509.CertificateX509Key;
|
|
||||||
import sun.security.x509.X500Name;
|
|
||||||
import sun.security.x509.X509CertImpl;
|
|
||||||
import sun.security.x509.X509CertInfo;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.security.KeyPair;
|
|
||||||
import java.security.PrivateKey;
|
|
||||||
import java.security.SecureRandom;
|
|
||||||
import java.security.cert.CertificateException;
|
|
||||||
|
|
||||||
import static io.netty.handler.ssl.util.SelfSignedCertificate.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates a self-signed certificate using {@code sun.security.x509} package provided by OpenJDK.
|
|
||||||
*/
|
|
||||||
final class OpenJdkSelfSignedCertGenerator {
|
|
||||||
|
|
||||||
static String[] generate(String fqdn, KeyPair keypair, SecureRandom random, Date notBefore, Date notAfter,
|
|
||||||
String algorithm) throws Exception {
|
|
||||||
PrivateKey key = keypair.getPrivate();
|
|
||||||
|
|
||||||
// Prepare the information required for generating an X.509 certificate.
|
|
||||||
X509CertInfo info = new X509CertInfo();
|
|
||||||
X500Name owner = new X500Name("CN=" + fqdn);
|
|
||||||
info.set(X509CertInfo.VERSION, new CertificateVersion(CertificateVersion.V3));
|
|
||||||
info.set(X509CertInfo.SERIAL_NUMBER, new CertificateSerialNumber(new BigInteger(64, random)));
|
|
||||||
try {
|
|
||||||
info.set(X509CertInfo.SUBJECT, new CertificateSubjectName(owner));
|
|
||||||
} catch (CertificateException ignore) {
|
|
||||||
info.set(X509CertInfo.SUBJECT, owner);
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
info.set(X509CertInfo.ISSUER, new CertificateIssuerName(owner));
|
|
||||||
} catch (CertificateException ignore) {
|
|
||||||
info.set(X509CertInfo.ISSUER, owner);
|
|
||||||
}
|
|
||||||
info.set(X509CertInfo.VALIDITY, new CertificateValidity(notBefore, notAfter));
|
|
||||||
info.set(X509CertInfo.KEY, new CertificateX509Key(keypair.getPublic()));
|
|
||||||
info.set(X509CertInfo.ALGORITHM_ID,
|
|
||||||
// sha256WithRSAEncryption
|
|
||||||
new CertificateAlgorithmId(AlgorithmId.get("1.2.840.113549.1.1.11")));
|
|
||||||
|
|
||||||
// Sign the cert to identify the algorithm that's used.
|
|
||||||
X509CertImpl cert = new X509CertImpl(info);
|
|
||||||
cert.sign(key, algorithm.equalsIgnoreCase("EC") ? "SHA256withECDSA" : "SHA256withRSA");
|
|
||||||
|
|
||||||
// Update the algorithm and sign again.
|
|
||||||
info.set(CertificateAlgorithmId.NAME + '.' + CertificateAlgorithmId.ALGORITHM, cert.get(X509CertImpl.SIG_ALG));
|
|
||||||
cert = new X509CertImpl(info);
|
|
||||||
cert.sign(key, algorithm.equalsIgnoreCase("EC") ? "SHA256withECDSA" : "SHA256withRSA");
|
|
||||||
cert.verify(keypair.getPublic());
|
|
||||||
|
|
||||||
return newSelfSignedCertificate(fqdn, key, cert);
|
|
||||||
}
|
|
||||||
|
|
||||||
private OpenJdkSelfSignedCertGenerator() { }
|
|
||||||
}
|
|
@ -21,7 +21,6 @@ import io.netty.buffer.Unpooled;
|
|||||||
import io.netty.handler.codec.base64.Base64;
|
import io.netty.handler.codec.base64.Base64;
|
||||||
import io.netty.util.CharsetUtil;
|
import io.netty.util.CharsetUtil;
|
||||||
import io.netty.util.internal.SystemPropertyUtil;
|
import io.netty.util.internal.SystemPropertyUtil;
|
||||||
import io.netty.util.internal.ThrowableUtil;
|
|
||||||
import io.netty.util.internal.logging.InternalLogger;
|
import io.netty.util.internal.logging.InternalLogger;
|
||||||
import io.netty.util.internal.logging.InternalLoggerFactory;
|
import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||||
|
|
||||||
@ -53,8 +52,8 @@ import java.util.Date;
|
|||||||
* {@link java.io.File#createTempFile(String, String)}, and they are deleted when the JVM exits using
|
* {@link java.io.File#createTempFile(String, String)}, and they are deleted when the JVM exits using
|
||||||
* {@link java.io.File#deleteOnExit()}.
|
* {@link java.io.File#deleteOnExit()}.
|
||||||
* </p><p>
|
* </p><p>
|
||||||
* At first, this method tries to use OpenJDK's X.509 implementation (the {@code sun.security.x509} package).
|
* The certificate is generated using <a href="http://www.bouncycastle.org/">Bouncy Castle</a>, which is an
|
||||||
* If it fails, it tries to use <a href="http://www.bouncycastle.org/">Bouncy Castle</a> as a fallback.
|
* <em>optional</em> dependency of Netty.
|
||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public final class SelfSignedCertificate {
|
public final class SelfSignedCertificate {
|
||||||
@ -235,22 +234,13 @@ public final class SelfSignedCertificate {
|
|||||||
|
|
||||||
String[] paths;
|
String[] paths;
|
||||||
try {
|
try {
|
||||||
// Try the OpenJDK's proprietary implementation.
|
|
||||||
paths = OpenJdkSelfSignedCertGenerator.generate(fqdn, keypair, random, notBefore, notAfter, algorithm);
|
|
||||||
} catch (Throwable t) {
|
|
||||||
logger.debug("Failed to generate a self-signed X.509 certificate using sun.security.x509:", t);
|
|
||||||
try {
|
|
||||||
// Try Bouncy Castle if the current JVM didn't have sun.security.x509.
|
|
||||||
paths = BouncyCastleSelfSignedCertGenerator.generate(
|
paths = BouncyCastleSelfSignedCertGenerator.generate(
|
||||||
fqdn, keypair, random, notBefore, notAfter, algorithm);
|
fqdn, keypair, random, notBefore, notAfter, algorithm);
|
||||||
} catch (Throwable t2) {
|
} catch (Throwable throwable) {
|
||||||
logger.debug("Failed to generate a self-signed X.509 certificate using Bouncy Castle:", t2);
|
logger.debug("Failed to generate a self-signed X.509 certificate using Bouncy Castle:", throwable);
|
||||||
final CertificateException certificateException = new CertificateException(
|
throw new CertificateException(
|
||||||
"No provider succeeded to generate a self-signed certificate. " +
|
"No provider succeeded to generate a self-signed certificate. " +
|
||||||
"See debug log for the root cause.", t2);
|
"See debug log for the root cause.", throwable);
|
||||||
ThrowableUtil.addSuppressed(certificateException, t);
|
|
||||||
throw certificateException;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
certificate = new File(paths[0]);
|
certificate = new File(paths[0]);
|
||||||
|
101
pom.xml
101
pom.xml
@ -199,45 +199,6 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
<!-- JDK10 -->
|
|
||||||
<profile>
|
|
||||||
<id>java10</id>
|
|
||||||
<activation>
|
|
||||||
<jdk>10</jdk>
|
|
||||||
</activation>
|
|
||||||
<properties>
|
|
||||||
<argLine.java9.extras />
|
|
||||||
<!-- Export some stuff which is used during our tests -->
|
|
||||||
<argLine.java9>--illegal-access=deny --add-modules java.xml.bind ${argLine.java9.extras}</argLine.java9>
|
|
||||||
<!-- Not use alpn agent as Java10 supports alpn out of the box -->
|
|
||||||
<argLine.alpnAgent />
|
|
||||||
<forbiddenapis.skip>true</forbiddenapis.skip>
|
|
||||||
<!-- Needed because of https://issues.apache.org/jira/browse/MENFORCER-275 -->
|
|
||||||
<enforcer.plugin.version>3.0.0-M3</enforcer.plugin.version>
|
|
||||||
<!-- 1.4.x does not work in Java10+ -->
|
|
||||||
<jboss.marshalling.version>2.0.5.Final</jboss.marshalling.version>
|
|
||||||
</properties>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<!-- JDK9 -->
|
|
||||||
<profile>
|
|
||||||
<id>java9</id>
|
|
||||||
<properties>
|
|
||||||
<argLine.java9.extras />
|
|
||||||
<!-- Export some stuff which is used during our tests -->
|
|
||||||
<argLine.java9>--illegal-access=deny --add-modules java.xml.bind ${argLine.java9.extras}</argLine.java9>
|
|
||||||
<!-- Not use alpn agent as Java9 supports alpn out of the box -->
|
|
||||||
<argLine.alpnAgent />
|
|
||||||
<!-- Skip as maven plugin not works with Java9 yet -->
|
|
||||||
<forbiddenapis.skip>true</forbiddenapis.skip>
|
|
||||||
<!-- Needed because of https://issues.apache.org/jira/browse/MENFORCER-275 -->
|
|
||||||
<enforcer.plugin.version>3.0.0-M1</enforcer.plugin.version>
|
|
||||||
</properties>
|
|
||||||
<activation>
|
|
||||||
<jdk>9</jdk>
|
|
||||||
</activation>
|
|
||||||
</profile>
|
|
||||||
|
|
||||||
<profile>
|
<profile>
|
||||||
<id>boringssl</id>
|
<id>boringssl</id>
|
||||||
<properties>
|
<properties>
|
||||||
@ -290,12 +251,12 @@
|
|||||||
</build>
|
</build>
|
||||||
</profile>
|
</profile>
|
||||||
<profile>
|
<profile>
|
||||||
<id>jdk8</id>
|
<id>relaxjavadoc</id>
|
||||||
<activation>
|
<activation>
|
||||||
<jdk>[1.8,)</jdk>
|
<jdk>[11,)</jdk>
|
||||||
</activation>
|
</activation>
|
||||||
<properties>
|
<properties>
|
||||||
<!-- Our Javadoc has poor enough quality to fail the build thanks to JDK8 javadoc which got more strict. -->
|
<!-- Our Javadoc has poor enough quality to fail the build thanks to JDK8+ javadoc which got more strict. -->
|
||||||
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
|
<maven.javadoc.failOnError>false</maven.javadoc.failOnError>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
@ -319,8 +280,8 @@
|
|||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
<netty.dev.tools.directory>${project.build.directory}/dev-tools</netty.dev.tools.directory>
|
<netty.dev.tools.directory>${project.build.directory}/dev-tools</netty.dev.tools.directory>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
@ -353,6 +314,7 @@
|
|||||||
<conscrypt.artifactId>conscrypt-openjdk-uber</conscrypt.artifactId>
|
<conscrypt.artifactId>conscrypt-openjdk-uber</conscrypt.artifactId>
|
||||||
<conscrypt.version>2.4.0</conscrypt.version>
|
<conscrypt.version>2.4.0</conscrypt.version>
|
||||||
<conscrypt.classifier />
|
<conscrypt.classifier />
|
||||||
|
<bouncycastle.version>1.66</bouncycastle.version>
|
||||||
<jni.classifier>${os.detected.name}-${os.detected.arch}</jni.classifier>
|
<jni.classifier>${os.detected.name}-${os.detected.arch}</jni.classifier>
|
||||||
<logging.config>${project.basedir}/../common/src/test/resources/logback-test.xml</logging.config>
|
<logging.config>${project.basedir}/../common/src/test/resources/logback-test.xml</logging.config>
|
||||||
<logging.logLevel>debug</logging.logLevel>
|
<logging.logLevel>debug</logging.logLevel>
|
||||||
@ -483,14 +445,13 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Bouncy Castle - completely optional, only needed when:
|
Bouncy Castle - completely optional, only needed when you generate a temporary self-signed
|
||||||
- you generate a temporary self-signed certificate using SelfSignedCertificate, and
|
certificate using SelfSignedCertificate.
|
||||||
- you don't use the JDK which doesn't provide sun.security.x509 package.
|
|
||||||
-->
|
-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcpkix-jdk15on</artifactId>
|
<artifactId>bcpkix-jdk15on</artifactId>
|
||||||
<version>1.65</version>
|
<version>${bouncycastle.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -502,7 +463,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk15on</artifactId>
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
<version>1.54</version>
|
<version>${bouncycastle.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
@ -773,9 +734,9 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<rules>
|
<rules>
|
||||||
<requireJavaVersion>
|
<requireJavaVersion>
|
||||||
<!-- Enforce JDK 1.8+ for compilation. -->
|
<!-- Enforce JDK 11+ for compilation. -->
|
||||||
<!-- This is needed because of java.util.zip.Deflater and NIO UDP multicast. -->
|
<!-- This is needed because of java.util.zip.Deflater and NIO UDP multicast. -->
|
||||||
<version>[1.8.0,)</version>
|
<version>[11.0.0,)</version>
|
||||||
</requireJavaVersion>
|
</requireJavaVersion>
|
||||||
<requireMavenVersion>
|
<requireMavenVersion>
|
||||||
<version>[3.1.1,)</version>
|
<version>[3.1.1,)</version>
|
||||||
@ -796,10 +757,11 @@
|
|||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.0</version>
|
<version>3.8.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<compilerVersion>1.8</compilerVersion>
|
<compilerVersion>11</compilerVersion>
|
||||||
<fork>true</fork>
|
<fork>true</fork>
|
||||||
<source>${maven.compiler.source}</source>
|
<source>${maven.compiler.source}</source>
|
||||||
<target>${maven.compiler.target}</target>
|
<target>${maven.compiler.target}</target>
|
||||||
|
<release>${maven.compiler.target}</release>
|
||||||
<debug>true</debug>
|
<debug>true</debug>
|
||||||
<optimize>true</optimize>
|
<optimize>true</optimize>
|
||||||
<showDeprecation>true</showDeprecation>
|
<showDeprecation>true</showDeprecation>
|
||||||
@ -820,41 +782,6 @@
|
|||||||
</excludes>
|
</excludes>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<!-- ensure that only methods available in java 1.6 can
|
|
||||||
be used even when compiling with java 1.7+ -->
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
|
||||||
<version>1.16</version>
|
|
||||||
<configuration>
|
|
||||||
<signature>
|
|
||||||
<groupId>org.codehaus.mojo.signature</groupId>
|
|
||||||
<artifactId>java18</artifactId>
|
|
||||||
<version>1.0</version>
|
|
||||||
</signature>
|
|
||||||
<ignores>
|
|
||||||
<!--
|
|
||||||
We need to whitelist MethodHandle as animal-sniffer can not handle it correctly
|
|
||||||
https://github.com/mojohaus/animal-sniffer/issues/67
|
|
||||||
-->
|
|
||||||
<ignore>java.lang.invoke.MethodHandle</ignore>
|
|
||||||
<ignore>sun.misc.Unsafe</ignore>
|
|
||||||
<ignore>sun.misc.Cleaner</ignore>
|
|
||||||
<ignore>sun.nio.ch.DirectBuffer</ignore>
|
|
||||||
</ignores>
|
|
||||||
<annotations>
|
|
||||||
<annotation>io.netty.util.internal.SuppressJava6Requirement</annotation>
|
|
||||||
</annotations>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>process-classes</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>check</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.1.0</version>
|
||||||
|
@ -62,17 +62,6 @@
|
|||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- Disable animal sniffer -->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>animal-sniffer-maven-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>default</id>
|
|
||||||
<phase>none</phase>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<!-- Disable checkstyle -->
|
<!-- Disable checkstyle -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||||
|
@ -94,6 +94,16 @@
|
|||||||
<artifactId>logback-classic</artifactId>
|
<artifactId>logback-classic</artifactId>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcpkix-jdk15on</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -53,8 +53,8 @@
|
|||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
<!-- Needed for SelfSignedCertificate -->
|
<!-- Needed for SelfSignedCertificate -->
|
||||||
<argLine.java9.extras>--add-exports java.base/sun.security.x509=ALL-UNNAMED</argLine.java9.extras>
|
<argLine.java9.extras>--add-exports java.base/sun.security.x509=ALL-UNNAMED</argLine.java9.extras>
|
||||||
<skipJapicmp>true</skipJapicmp>
|
<skipJapicmp>true</skipJapicmp>
|
||||||
|
@ -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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class AbstractNotificationHandler<T> implements NotificationHandler<T> {
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
public class Association {
|
|
||||||
static {
|
|
||||||
UnsupportedOperatingSystemException.raise();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
public abstract class AssociationChangeNotification implements Notification {
|
|
||||||
static {
|
|
||||||
UnsupportedOperatingSystemException.raise();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
public enum HandlerResult {
|
|
||||||
CONTINUE, RETURN
|
|
||||||
}
|
|
@ -1,38 +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 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();
|
|
||||||
public abstract boolean isUnordered();
|
|
||||||
public abstract MessageInfo unordered(boolean b);
|
|
||||||
|
|
||||||
}
|
|
@ -1,20 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
public interface Notification {
|
|
||||||
Association association();
|
|
||||||
}
|
|
@ -1,19 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
public interface NotificationHandler<T> {
|
|
||||||
}
|
|
@ -1,22 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
public abstract class PeerAddressChangeNotification implements Notification {
|
|
||||||
static {
|
|
||||||
UnsupportedOperatingSystemException.raise();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,58 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.SocketAddress;
|
|
||||||
import java.nio.ByteBuffer;
|
|
||||||
import java.nio.channels.spi.AbstractSelectableChannel;
|
|
||||||
import java.nio.channels.spi.SelectorProvider;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
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> T getOption(SctpSocketOption<T> name) throws IOException;
|
|
||||||
public abstract <T> SctpChannel setOption(SctpSocketOption<T> name, T value) throws IOException;
|
|
||||||
|
|
||||||
public abstract Set<SocketAddress> getAllLocalAddresses() throws IOException;
|
|
||||||
public abstract Set<SocketAddress> 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 SctpChannel bindAddress(InetAddress inetAddress) throws IOException;
|
|
||||||
public abstract SctpChannel unbindAddress(InetAddress inetAddress) throws IOException;
|
|
||||||
|
|
||||||
public abstract <T> MessageInfo receive(ByteBuffer dst, T attachment, NotificationHandler<T> handler) throws IOException;
|
|
||||||
public abstract int send(ByteBuffer src, MessageInfo messageInfo) throws IOException;
|
|
||||||
|
|
||||||
public abstract Set<SctpSocketOption<?>> supportedOptions();
|
|
||||||
}
|
|
@ -1,51 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.InetAddress;
|
|
||||||
import java.net.SocketAddress;
|
|
||||||
import java.nio.channels.spi.AbstractSelectableChannel;
|
|
||||||
import java.nio.channels.spi.SelectorProvider;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
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> T getOption(SctpSocketOption<T> name) throws IOException;
|
|
||||||
public abstract <T> SctpServerChannel setOption(SctpSocketOption<T> name, T value) throws IOException;
|
|
||||||
|
|
||||||
public abstract Set<SocketAddress> getAllLocalAddresses() throws IOException;
|
|
||||||
|
|
||||||
public abstract SctpServerChannel bind(SocketAddress local) throws IOException;
|
|
||||||
public abstract SctpServerChannel bind(SocketAddress local, int backlog) throws IOException;
|
|
||||||
|
|
||||||
public abstract SctpServerChannel bindAddress(InetAddress inetAddress) throws IOException;
|
|
||||||
public abstract SctpServerChannel unbindAddress(InetAddress inetAddress) throws IOException;
|
|
||||||
|
|
||||||
public abstract SctpChannel accept() throws IOException;
|
|
||||||
}
|
|
@ -1,21 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
public interface SctpSocketOption<T> {
|
|
||||||
String name();
|
|
||||||
Class<T> type();
|
|
||||||
}
|
|
@ -1,52 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
import java.net.SocketAddress;
|
|
||||||
|
|
||||||
@SuppressWarnings("all")
|
|
||||||
public class SctpStandardSocketOptions {
|
|
||||||
static {
|
|
||||||
UnsupportedOperatingSystemException.raise();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final SctpSocketOption<Boolean> SCTP_DISABLE_FRAGMENTS = null;
|
|
||||||
public static final SctpSocketOption<Boolean> SCTP_EXPLICIT_COMPLETE = null;
|
|
||||||
public static final SctpSocketOption<Integer> SCTP_FRAGMENT_INTERLEAVE = null;
|
|
||||||
public static final SctpSocketOption<InitMaxStreams> SCTP_INIT_MAXSTREAMS = null;
|
|
||||||
public static final SctpSocketOption<Boolean> SCTP_NODELAY = null;
|
|
||||||
public static final SctpSocketOption<SocketAddress> SCTP_PRIMARY_ADDR = null;
|
|
||||||
public static final SctpSocketOption<SocketAddress> SCTP_SET_PEER_PRIMARY_ADDR = null;
|
|
||||||
public static final SctpSocketOption<Integer> SO_LINGER = null;
|
|
||||||
public static final SctpSocketOption<Integer> SO_RCVBUF = null;
|
|
||||||
public static final SctpSocketOption<Integer> SO_SNDBUF = null;
|
|
||||||
|
|
||||||
public static class InitMaxStreams {
|
|
||||||
|
|
||||||
public static InitMaxStreams create(int i, int i1) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int maxInStreams() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int maxOutStreams() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
public abstract class SendFailedNotification implements Notification {
|
|
||||||
static {
|
|
||||||
UnsupportedOperatingSystemException.raise();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
public abstract class ShutdownNotification implements Notification {
|
|
||||||
static {
|
|
||||||
UnsupportedOperatingSystemException.raise();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +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 com.sun.nio.sctp;
|
|
||||||
|
|
||||||
public class UnsupportedOperatingSystemException extends RuntimeException {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = -221782446524784377L;
|
|
||||||
|
|
||||||
public static void raise() {
|
|
||||||
throw new UnsupportedOperatingSystemException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsupportedOperatingSystemException() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsupportedOperatingSystemException(String message) {
|
|
||||||
super(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsupportedOperatingSystemException(String message, Throwable cause) {
|
|
||||||
super(message, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public UnsupportedOperatingSystemException(Throwable cause) {
|
|
||||||
super(cause);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This package is only included to let SCTP also compile on non-unix operation systems.
|
|
||||||
*
|
|
||||||
* <strong>This will not get included in the generated jar!</strong>
|
|
||||||
*/
|
|
||||||
package com.sun.nio.sctp;
|
|
@ -27,7 +27,6 @@ import com.sun.nio.sctp.ShutdownNotification;
|
|||||||
|
|
||||||
import io.netty.channel.ChannelPipeline;
|
import io.netty.channel.ChannelPipeline;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link AbstractNotificationHandler} implementation which will handle all {@link Notification}s by trigger a
|
* {@link AbstractNotificationHandler} implementation which will handle all {@link Notification}s by trigger a
|
||||||
* {@link Notification} user event in the {@link ChannelPipeline} of a {@link SctpChannel}.
|
* {@link Notification} user event in the {@link ChannelPipeline} of a {@link SctpChannel}.
|
||||||
|
Loading…
Reference in New Issue
Block a user