// Create client.
InvokerLocator clientLocator = new InvokerLocator(locatorURI);
HashMap clientConfig = new HashMap();
clientConfig.put(InvokerLocator.FORCE_REMOTE, "true");
clientConfig.put(SocketWrapper.WRITE_TIMEOUT, "1000");
SocketFactory sf = (SocketFactory) getSocketFactoryConstructor().newInstance(new Object[]{new Integer(5000), new Integer(1)});
clientConfig.put(Remoting.CUSTOM_SOCKET_FACTORY, sf);
addExtraClientConfig(clientConfig);
Client client = new Client(clientLocator, clientConfig);
client.connect();
log.info("client is connected");