I'm trying to use a custom SocketImpl with SSL in Java. Because of that I need to set ServerSocket's socket factory. I now noticed that it's static, which creates some hassle for me as a I want to supply it with some paramaters that differs between in each ServerSocket-instance. Does anyone know the rationale behind making it static? To me it feels like an unnecessary constraint that only introduces more global state in your app.
Update There seems to be some confusion on why this is a hassle. The problem this creates is that it forces me to use the same factory across the entire application. What if I want to use the default SocketImpl in one place and a custom one in another? That can't be done without resorting to some ugly reflection-hacks, because the factory can't be changed once it has been set. I also can't make my factory create default implementation because SocksSocketImpl is package private.