Configure SocketFactories client-side
This topic has not yet been written. The content below is from the topic description.
For SocketFactorys in client invokers, there are seven options for programmatic configuration, and they are essentially the same as 1-3 and 5-8 in the previous section (Client has no facility for parsing xml documents: Get the ClientInvoker by calling Client.getInvoker() and call ClientInvoker.setSocketFactory(). Call Client.setSocketFactory(). Put a constructed SocketFactory in a configuration map, using key Remoting.CUSTOM_SOCKET_FACTORY, and pass the map to one of the Client constructors. Put the class name of a SocketFactory in a configuration map, using key Remoting.SOCKET_FACTORY_CLASS_NAME, and pass the map to one of the Client constructors. The SocketFactory class must have a default constructor, which will be used to create a SocketFactory. Put a set of SSL parameters, using the keys in org.jboss.remoting.security.SSLSocketBuilder, in a configuration map and pass the map to one of the Client constructors. These will be used by SSLSocketBuilder (see below) to create a CustomSSLSocketFactory. Configure an appropriate set of SSL system properties and use one of the SSL transports (https, sslrmi, or sslsocket). The properties will be used to create some kind of SSLSocketFactory, as determined by the transport. Use one of the non-SSL transports and do nothing. Ordinary Sockets will be used. Again, these are essentially in descending order of precedence. Options 1, 2, 3, and 4 are illustrated in FactoryConfigSample and options 5 and 6 are illustrated in FactoryConfigSSLSample, both of which are in package org.jboss.remoting.samples.config.factories. Timing considerations. A SocketFactory is created in the constructor for RemoteClientInvoker, the ancestor of all current remote client invokers (that is, all client invokers except LocalClientInvoker, which can make a call by reference on a server invoker in the same JVM), but it is currently used only by SSL transports, for which the timing considerations vary. https: HTTPSClientInvoker sets the socket factory on its HttpsURLConnection each time Client.invoke() is called. Option 1 may be used to reset the SocketFactory for future invocations at any time. sslrmi: A SocketFactory is either created or configured for future creation during Client.create(). No further configuration is possible. sslsocket: SSLSocketClientInvoker uses the current SocketFactory to create a new socket whenever it runs out of available pooled connections. Option 1 may be used to reset the SocketFactory for future connections at any time.