JDK-8235140 : Investigate deprecation of the Socket/ServerSocket impl factory mechanism
  • Type: Sub-task
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 14
  • Priority: P4
  • Status: Resolved
  • Resolution: Delivered
  • Submitted: 2019-11-29
  • Updated: 2021-02-12
  • Resolved: 2021-02-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17Resolved
Description
This subtask proposes to deprecate, and eventually remove, the API points
for statically configuring a system-wide factory for the Soket/SocketServer types in
the java.net package. Specifically, the following:

 * Methods:
  1) static void ServerSocket.setSocketFactory���(SocketImplFactory fac)
  2) static void Socket.setSocketImplFactory���(SocketImplFactory fac)
  
* Types
  a) java.net SocketImplFactory 

The java.net SocketImplFactory can be deprecated too, but we might not be able to remove it completely.

The alternative to using ServerSocket.setSocketFactory and Socket.setSocketImplFactory is to subclass Socket/ServerSocket and call the constructor that takes a SocketImpl.