private static ProxyFactory createProxyFactory(String clientKeystorePath, String password, CertificateTrustValidator validator) {
DefaultInvocationEngine engine;
AxisTransport transport;
IdentityProvider idp;
WSDLCache cache;
SAMLTokenCache tokenCache;
GridClientPluginManager pluginManager;
ProxyFactory proxyFactory;
ProxyFactory rawProxyFactory;
EndpointReferenceType pesEpr;
RemotePesService pesProxy;
CertificateTrustValidator manager;
try {
// Create a keystore identity
System.out.println("Client keystore = " + clientKeystorePath);
idp = new KeystoreIdentityProvider(clientKeystorePath, password.toCharArray());
// Create transport object which invokes operations
System.out.println("Setting up secure transport layer");
transport = new AxisTransport(idp);
// We need a cache to store our wsdl files
cache = new WSDLCacheImpl(transport);
manager = validator;
transport.setCertificateTrustValidator(manager);
ITInnovSocketFactory.setHandlers(idp, manager);
// Define a cache for any tokens we get from Membership Groups
tokenCache = new SAMLTokenCache();
// Define an engine which uses the transport to invoke operations
System.out.println("Creating an invocation engine");
engine = new DefaultInvocationEngine(transport);