From 2344f775fe0aff618992b2c9093fe19be82d83a4 Mon Sep 17 00:00:00 2001 From: michaelm Date: Thu, 10 Oct 2013 12:36:42 +0100 Subject: [PATCH] 7076487: (sctp) SCTP API classes does not exist in JDK for Mac Reviewed-by: alanb, chegar --- makefiles/CompileJavaClasses.gmk | 5 +- makefiles/CreateJars.gmk | 5 - .../sun/nio/ch/sctp/SctpChannelImpl.java | 150 ++++++++++++++++++ .../sun/nio/ch/sctp/SctpMultiChannelImpl.java | 137 ++++++++++++++++ .../nio/ch/sctp/SctpServerChannelImpl.java | 102 ++++++++++++ 5 files changed, 393 insertions(+), 6 deletions(-) create mode 100644 src/macosx/classes/sun/nio/ch/sctp/SctpChannelImpl.java create mode 100644 src/macosx/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java create mode 100644 src/macosx/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java diff --git a/makefiles/CompileJavaClasses.gmk b/makefiles/CompileJavaClasses.gmk index 36aaa0861..ac4f51445 100644 --- a/makefiles/CompileJavaClasses.gmk +++ b/makefiles/CompileJavaClasses.gmk @@ -268,7 +268,10 @@ ifeq ($(OPENJDK_TARGET_OS),macosx) $(JDK_TOPDIR)/src/solaris/classes/java/net/DefaultInterface.java \ $(JDK_TOPDIR)/src/solaris/classes/java/lang/ClassLoaderHelper.java \ $(JDK_TOPDIR)/src/solaris/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java \ - $(JDK_TOPDIR)/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java + $(JDK_TOPDIR)/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java \ + $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java \ + $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java \ + $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java # JObjC.jar contains 1.5 byte-code...so skip it here :-( # MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/jobjc/src diff --git a/makefiles/CreateJars.gmk b/makefiles/CreateJars.gmk index 7ef97646f..4c10ab43f 100644 --- a/makefiles/CreateJars.gmk +++ b/makefiles/CreateJars.gmk @@ -216,11 +216,6 @@ RT_JAR_EXCLUDES += \ oracle/jrockit/jfr \ jdk/jfr -ifeq ($(OPENJDK_TARGET_OS), macosx) - RT_JAR_EXCLUDES += com/sun/nio/sctp \ - sun/nio/ch/sctp -endif - # Find all files in the classes dir to use as dependencies. This could be more fine granular. ALL_FILES_IN_CLASSES := $(call not-containing,_the.,$(filter-out %javac_state,\ $(call CacheFind,$(JDK_OUTPUTDIR)/classes))) diff --git a/src/macosx/classes/sun/nio/ch/sctp/SctpChannelImpl.java b/src/macosx/classes/sun/nio/ch/sctp/SctpChannelImpl.java new file mode 100644 index 000000000..8a1472034 --- /dev/null +++ b/src/macosx/classes/sun/nio/ch/sctp/SctpChannelImpl.java @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.nio.ch.sctp; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.ByteBuffer; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.Association; +import com.sun.nio.sctp.MessageInfo; +import com.sun.nio.sctp.NotificationHandler; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpChannelImpl extends SctpChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public Association association() { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel bind(SocketAddress local) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean connect(SocketAddress remote) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean connect(SocketAddress remote, int maxOutStreams, + int maxInStreams) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean isConnectionPending() { + throw new UnsupportedOperationException(message); + } + + @Override + public boolean finishConnect() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getRemoteAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel shutdown() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public T getOption(SctpSocketOption name) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel setOption(SctpSocketOption name, T value) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + public MessageInfo receive(ByteBuffer dst, T attachment, + NotificationHandler handler) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public int send(ByteBuffer src, MessageInfo messageInfo) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} diff --git a/src/macosx/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java b/src/macosx/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java new file mode 100644 index 000000000..c2c1d9683 --- /dev/null +++ b/src/macosx/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.nio.ch.sctp; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.ByteBuffer; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.Association; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.MessageInfo; +import com.sun.nio.sctp.NotificationHandler; +import com.sun.nio.sctp.SctpMultiChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpMultiChannelImpl extends SctpMultiChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpMultiChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public Set associations() { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel bind(SocketAddress local, + int backlog) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getRemoteAddresses + (Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel shutdown(Association association) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public T getOption(SctpSocketOption name, + Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpMultiChannel setOption(SctpSocketOption name, + T value, Association association) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + public MessageInfo receive(ByteBuffer buffer, T attachment, + NotificationHandler handler) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public int send(ByteBuffer buffer, MessageInfo messageInfo) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel branch(Association association) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} diff --git a/src/macosx/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java b/src/macosx/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java new file mode 100644 index 000000000..1e224afd1 --- /dev/null +++ b/src/macosx/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.nio.ch.sctp; + +import java.net.SocketAddress; +import java.net.InetAddress; +import java.io.IOException; +import java.util.Set; +import java.nio.channels.spi.SelectorProvider; +import com.sun.nio.sctp.SctpChannel; +import com.sun.nio.sctp.SctpServerChannel; +import com.sun.nio.sctp.SctpSocketOption; + +/** + * Unimplemented. + */ +public class SctpServerChannelImpl extends SctpServerChannel +{ + private static final String message = "SCTP not supported on this platform"; + + public SctpServerChannelImpl(SelectorProvider provider) { + super(provider); + throw new UnsupportedOperationException(message); + } + + @Override + public SctpChannel accept() throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel bind(SocketAddress local, + int backlog) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel bindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel unbindAddress(InetAddress address) + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set getAllLocalAddresses() + throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public T getOption(SctpSocketOption name) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public SctpServerChannel setOption(SctpSocketOption name, + T value) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public Set> supportedOptions() { + throw new UnsupportedOperationException(message); + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + throw new UnsupportedOperationException(message); + } + + @Override + public void implCloseSelectableChannel() throws IOException { + throw new UnsupportedOperationException(message); + } +} -- GitLab