public static boolean checkConnection(InvokerLocator locator, Map config) throws Throwable
{
boolean pingWorked = false;
Map configMap = createPingConfig(config, null);
int pingTimeout = Integer.parseInt((String) configMap.get(ServerInvoker.TIMEOUT));
ClientInvoker innerClientInvoker = null;
try
{
innerClientInvoker = InvokerRegistry.createClientInvoker(locator, configMap);
if (!innerClientInvoker.isConnected())
{
if (trace) { log.trace("inner client invoker not connected, connecting ..."); }
innerClientInvoker.connect();
}
pingWorked = doCheckConnection(innerClientInvoker, pingTimeout);
}
catch (Throwable throwable)
{
log.debug("ConnectionValidator unable to connect to server " +
innerClientInvoker.getLocator().getProtocol() + "://" +
innerClientInvoker.getLocator().getHost() + ":" +
innerClientInvoker.getLocator().getPort(), throwable);
}
finally
{
if (innerClientInvoker != null)
{