diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-03-02 21:52:35 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-03-02 21:52:35 +0000 |
commit | dc5571bb00a0a56b23e3cc29ac08b30fe45078b5 (patch) | |
tree | a91e78133b0a711ecbc38b3a94ff00ba3f437d19 /java/src/IceGridGUI/Coordinator.java | |
parent | bernard's comments (diff) | |
download | ice-dc5571bb00a0a56b23e3cc29ac08b30fe45078b5.tar.bz2 ice-dc5571bb00a0a56b23e3cc29ac08b30fe45078b5.tar.xz ice-dc5571bb00a0a56b23e3cc29ac08b30fe45078b5.zip |
Fixed bug #1846
Diffstat (limited to 'java/src/IceGridGUI/Coordinator.java')
-rwxr-xr-x | java/src/IceGridGUI/Coordinator.java | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/java/src/IceGridGUI/Coordinator.java b/java/src/IceGridGUI/Coordinator.java index 0d86c583d83..ee0e54158bf 100755 --- a/java/src/IceGridGUI/Coordinator.java +++ b/java/src/IceGridGUI/Coordinator.java @@ -1350,7 +1350,7 @@ public class Coordinator String str = "\"" + _communicator.identityToString(locatorId) + "\""; str += ":" + info.registryEndpoints; - RegistryPrx localRegistry = null; + RegistryPrx currentRegistry = null; try { @@ -1366,8 +1366,15 @@ public class Coordinator JOptionPane.ERROR_MESSAGE); return null; } - - localRegistry = defaultLocator.getLocalRegistry(); + + currentRegistry = defaultLocator.getLocalRegistry(); + + // + // Make sure the currentRegistry uses the same endpoints as the locator + // (for when IceGrid Admin is used over a ssh tunnel) + // + currentRegistry = RegistryPrxHelper.uncheckedCast( + currentRegistry.ice_endpoints(defaultLocator.ice_getEndpoints())); _communicator.setDefaultLocator(defaultLocator); } @@ -1381,17 +1388,17 @@ public class Coordinator return null; } - RegistryPrx registry = localRegistry; + RegistryPrx registry = currentRegistry; - if(info.connectToMaster) + if(info.connectToMaster && !currentRegistry.ice_getIdentity().name.equals("Registry")) { Ice.Identity masterRegistryId = new Ice.Identity(); masterRegistryId.category = info.registryInstanceName; masterRegistryId.name = "Registry"; registry = RegistryPrxHelper. - uncheckedCast(_communicator.stringToProxy("\"" + - _communicator.identityToString(masterRegistryId) + "\"")); + uncheckedCast(_communicator.stringToProxy( + "\"" + _communicator.identityToString(masterRegistryId) + "\"")); } do @@ -1413,6 +1420,16 @@ public class Coordinator assert session != null; } keepAlivePeriodHolder.value = registry.getSessionTimeout() * 1000 / 2; + + // + // Make sure the session uses the same endpoints as the locator + // (for when IceGrid Admin is used over a ssh tunnel) + // + if(registry == currentRegistry) + { + session = AdminSessionPrxHelper.uncheckedCast( + session.ice_endpoints(currentRegistry.ice_getEndpoints())); + } } catch(IceGrid.PermissionDeniedException e) { @@ -1425,7 +1442,7 @@ public class Coordinator } catch(Ice.LocalException e) { - if(registry.ice_getIdentity().equals(localRegistry.ice_getIdentity())) + if(registry.ice_getIdentity().equals(currentRegistry.ice_getIdentity())) { JOptionPane.showMessageDialog(parent, "Could not create session: " @@ -1444,8 +1461,7 @@ public class Coordinator JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { - - registry = localRegistry; + registry = currentRegistry; } else { |