OpenJDK / jdk / jdk
changeset 57307:f52cc36158cf
8234871: deprecate SocketFlow (SO_FLOW_SLA) and related APIs for removal
Reviewed-by: alanb, chegar
author | michaelm |
---|---|
date | Tue, 10 Dec 2019 11:26:04 +0000 |
parents | a4fb32538898 |
children | 9f4e98d4dcd4 |
files | src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java src/jdk.net/share/classes/jdk/net/NetworkPermission.java src/jdk.net/share/classes/jdk/net/SocketFlow.java src/jdk.net/share/classes/jdk/net/Sockets.java src/jdk.net/solaris/classes/jdk/net/SolarisSocketOptions.java |
diffstat | 5 files changed, 22 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java Tue Dec 10 10:34:31 2019 +0100 +++ b/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java Tue Dec 10 11:26:04 2019 +0000 @@ -64,7 +64,11 @@ * setting or getting this option requires a {@link NetworkPermission} * {@code ("setOption.SO_FLOW_SLA")} or {@code "getOption.SO_FLOW_SLA"} * respectively. + * @deprecated This is supported only on Solaris. Due to deprecation + * of Solaris port, this option is also deprecated. */ + @Deprecated(since="14", forRemoval=true) + @SuppressWarnings("removal") public static final SocketOption<SocketFlow> SO_FLOW_SLA = new ExtSocketOption<SocketFlow>("SO_FLOW_SLA", SocketFlow.class); @@ -192,6 +196,7 @@ new sun.net.ext.ExtendedSocketOptions(extendedOptions) { @Override + @SuppressWarnings("removal") public void setOption(FileDescriptor fd, SocketOption<?> option, Object value) @@ -222,6 +227,7 @@ } @Override + @SuppressWarnings("removal") public Object getOption(FileDescriptor fd, SocketOption<?> option) throws SocketException @@ -265,6 +271,7 @@ private static final JavaIOFileDescriptorAccess fdAccess = SharedSecrets.getJavaIOFileDescriptorAccess(); + @SuppressWarnings("removal") private static void setFlowOption(FileDescriptor fd, SocketFlow f) throws SocketException { @@ -274,6 +281,7 @@ f.status(status); // augment the given flow with the status } + @SuppressWarnings("removal") private static void getFlowOption(FileDescriptor fd, SocketFlow f) throws SocketException { int status = platformSocketOptions.getFlowOption(fdAccess.get(fd), f); @@ -362,6 +370,7 @@ throw new UnsupportedOperationException("unsupported socket option"); } + @SuppressWarnings("removal") int getFlowOption(int fd, SocketFlow f) throws SocketException { throw new UnsupportedOperationException("unsupported socket option"); }
--- a/src/jdk.net/share/classes/jdk/net/NetworkPermission.java Tue Dec 10 10:34:31 2019 +0100 +++ b/src/jdk.net/share/classes/jdk/net/NetworkPermission.java Tue Dec 10 11:26:04 2019 +0000 @@ -49,14 +49,15 @@ * <td>set the {@link ExtendedSocketOptions#SO_FLOW_SLA SO_FLOW_SLA} option * on any socket that supports it</td> * <td>allows caller to set a higher priority or bandwidth allocation - * to sockets it creates, than they might otherwise be allowed.</td> + * to sockets it creates, than they might otherwise be allowed. + * This permission is deprecated.</td> * </tr> * <tr> * <th scope="row">getOption.SO_FLOW_SLA</th> * <td>retrieve the {@link ExtendedSocketOptions#SO_FLOW_SLA SO_FLOW_SLA} * setting from any socket that supports the option</td> * <td>allows caller access to SLA information that it might not - * otherwise have</td> + * otherwise have. This permission is deprecated.</td> * </tr> * </tbody> * </table>
--- a/src/jdk.net/share/classes/jdk/net/SocketFlow.java Tue Dec 10 10:34:31 2019 +0100 +++ b/src/jdk.net/share/classes/jdk/net/SocketFlow.java Tue Dec 10 11:26:04 2019 +0000 @@ -43,8 +43,12 @@ * When a security manager is installed, a {@link NetworkPermission} * is required to set or get this option. * + * @deprecated This is supported only on Solaris. Due to deprecation + * of Solaris port, this feature is also deprecated. + * * @since 1.8 */ +@Deprecated(since="14", forRemoval=true) public class SocketFlow { @Native public static final int UNSET = -1; @@ -65,9 +69,13 @@ * socket option. Both setting and getting the option return * one of these statuses, which reflect the state of socket's * flow. + * @deprecated This is supported only on Solaris. Due to + * deprecation of Solaris port, this enum is also deprecated. * * @since 1.8 */ + @SuppressWarnings("removal") + @Deprecated(since="14", forRemoval=true) public enum Status { /** * Set or get socket option has not been called yet. Status
--- a/src/jdk.net/share/classes/jdk/net/Sockets.java Tue Dec 10 10:34:31 2019 +0100 +++ b/src/jdk.net/share/classes/jdk/net/Sockets.java Tue Dec 10 11:26:04 2019 +0000 @@ -259,6 +259,7 @@ return isReusePortAvailable; } + @SuppressWarnings("removal") private static Map<Class<?>,Set<SocketOption<?>>> optionSets() { Map<Class<?>,Set<SocketOption<?>>> options = new HashMap<>(); boolean flowsupported = PlatformSocketOptions.get().flowSupported();
--- a/src/jdk.net/solaris/classes/jdk/net/SolarisSocketOptions.java Tue Dec 10 10:34:31 2019 +0100 +++ b/src/jdk.net/solaris/classes/jdk/net/SolarisSocketOptions.java Tue Dec 10 11:26:04 2019 +0000 @@ -30,6 +30,7 @@ import java.security.PrivilegedAction; import jdk.net.ExtendedSocketOptions.PlatformSocketOptions; +@SuppressWarnings("removal") class SolarisSocketOptions extends PlatformSocketOptions { public SolarisSocketOptions() { }