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 | |
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')
-rwxr-xr-x | java/src/IceGridGUI/Coordinator.java | 36 | ||||
-rwxr-xr-x | java/src/IceGridGUI/LiveDeployment/Node.java | 14 | ||||
-rwxr-xr-x | java/src/IceGridGUI/LiveDeployment/Root.java | 12 | ||||
-rwxr-xr-x | java/src/IceGridGUI/LiveDeployment/Server.java | 25 | ||||
-rwxr-xr-x | java/src/IceGridGUI/LiveDeployment/Service.java | 10 | ||||
-rw-r--r-- | java/src/IceGridGUI/LiveDeployment/Slave.java | 12 | ||||
-rwxr-xr-x | java/src/IceGridGUI/SessionKeeper.java | 5 |
7 files changed, 88 insertions, 26 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 { diff --git a/java/src/IceGridGUI/LiveDeployment/Node.java b/java/src/IceGridGUI/LiveDeployment/Node.java index 704a7dfc8ed..794621e382c 100755 --- a/java/src/IceGridGUI/LiveDeployment/Node.java +++ b/java/src/IceGridGUI/LiveDeployment/Node.java @@ -48,16 +48,22 @@ class Node extends ListTreeNode public FileIteratorPrx open(int count) throws FileNotAvailableException, NodeNotExistException, NodeUnreachableException { - AdminSessionPrx adminSession = getRoot().getCoordinator().getSession(); - + AdminSessionPrx session = getRoot().getCoordinator().getSession(); + FileIteratorPrx result; if(stdout) { - return adminSession.openNodeStdOut(_id, count); + result = session.openNodeStdOut(_id, count); } else { - return adminSession.openNodeStdErr(_id, count); + result = session.openNodeStdErr(_id, count); + } + if(getRoot().getCoordinator().getCommunicator().getDefaultRouter() == null) + { + result = FileIteratorPrxHelper.uncheckedCast( + result.ice_endpoints(session.ice_getEndpoints())); } + return result; } public String getTitle() diff --git a/java/src/IceGridGUI/LiveDeployment/Root.java b/java/src/IceGridGUI/LiveDeployment/Root.java index f7433b44968..dc2cbb58c07 100755 --- a/java/src/IceGridGUI/LiveDeployment/Root.java +++ b/java/src/IceGridGUI/LiveDeployment/Root.java @@ -918,14 +918,22 @@ public class Root extends ListArrayTreeNode { AdminSessionPrx session = _coordinator.getSession(); + FileIteratorPrx result; if(stdout) { - return session.openRegistryStdOut(_replicaName, count); + result = session.openRegistryStdOut(_replicaName, count); } else { - return session.openRegistryStdErr(_replicaName, count); + result = session.openRegistryStdErr(_replicaName, count); } + + if(_coordinator.getCommunicator().getDefaultRouter() == null) + { + result = FileIteratorPrxHelper.uncheckedCast( + result.ice_endpoints(session.ice_getEndpoints())); + } + return result; } public String getTitle() diff --git a/java/src/IceGridGUI/LiveDeployment/Server.java b/java/src/IceGridGUI/LiveDeployment/Server.java index 275bc022f46..4ba21661ef3 100755 --- a/java/src/IceGridGUI/LiveDeployment/Server.java +++ b/java/src/IceGridGUI/LiveDeployment/Server.java @@ -177,16 +177,22 @@ class Server extends ListArrayTreeNode public FileIteratorPrx open(int count) throws FileNotAvailableException, ServerNotExistException, NodeUnreachableException, DeploymentException { - AdminSessionPrx adminSession = getRoot().getCoordinator().getSession(); - + AdminSessionPrx session = getRoot().getCoordinator().getSession(); + FileIteratorPrx result; if(stdout) { - return adminSession.openServerStdOut(_id, count); + result = session.openServerStdOut(_id, count); } else { - return adminSession.openServerStdErr(_id, count); + result = session.openServerStdErr(_id, count); + } + if(getRoot().getCoordinator().getCommunicator().getDefaultRouter() == null) + { + result = FileIteratorPrxHelper.uncheckedCast( + result.ice_endpoints(session.ice_getEndpoints())); } + return result; } public String getTitle() @@ -237,8 +243,15 @@ class Server extends ListArrayTreeNode throws FileNotAvailableException, ServerNotExistException, NodeUnreachableException, DeploymentException { - AdminSessionPrx adminSession = getRoot().getCoordinator().getSession(); - return adminSession.openServerLog(_id, fPath, count); + AdminSessionPrx session = getRoot().getCoordinator().getSession(); + FileIteratorPrx result = session.openServerLog(_id, fPath, count); + + if(getRoot().getCoordinator().getCommunicator().getDefaultRouter() == null) + { + result = FileIteratorPrxHelper.uncheckedCast( + result.ice_endpoints(session.ice_getEndpoints())); + } + return result; } public String getTitle() diff --git a/java/src/IceGridGUI/LiveDeployment/Service.java b/java/src/IceGridGUI/LiveDeployment/Service.java index 5fd67100a4f..5e665714388 100755 --- a/java/src/IceGridGUI/LiveDeployment/Service.java +++ b/java/src/IceGridGUI/LiveDeployment/Service.java @@ -72,8 +72,14 @@ class Service extends ListArrayTreeNode throws FileNotAvailableException, ServerNotExistException, NodeUnreachableException, DeploymentException { - AdminSessionPrx adminSession = getRoot().getCoordinator().getSession(); - return adminSession.openServerLog(_parent.getId(), fPath, count); + AdminSessionPrx session = getRoot().getCoordinator().getSession(); + FileIteratorPrx result = session.openServerLog(_parent.getId(), fPath, count); + if(getRoot().getCoordinator().getCommunicator().getDefaultRouter() == null) + { + result = FileIteratorPrxHelper.uncheckedCast( + result.ice_endpoints(session.ice_getEndpoints())); + } + return result; } public String getTitle() diff --git a/java/src/IceGridGUI/LiveDeployment/Slave.java b/java/src/IceGridGUI/LiveDeployment/Slave.java index 63c450d5928..4c0265f927d 100644 --- a/java/src/IceGridGUI/LiveDeployment/Slave.java +++ b/java/src/IceGridGUI/LiveDeployment/Slave.java @@ -90,14 +90,22 @@ class Slave extends TreeNode { AdminSessionPrx session = getCoordinator().getSession(); + FileIteratorPrx result; if(stdout) { - return session.openRegistryStdOut(_id, count); + result = session.openRegistryStdOut(_id, count); } else { - return session.openRegistryStdErr(_id, count); + result = session.openRegistryStdErr(_id, count); } + + if(getCoordinator().getCommunicator().getDefaultRouter() == null) + { + result = FileIteratorPrxHelper.uncheckedCast( + result.ice_endpoints(session.ice_getEndpoints())); + } + return result; } public String getTitle() diff --git a/java/src/IceGridGUI/SessionKeeper.java b/java/src/IceGridGUI/SessionKeeper.java index 499a7b6b5d3..f9935bded5b 100755 --- a/java/src/IceGridGUI/SessionKeeper.java +++ b/java/src/IceGridGUI/SessionKeeper.java @@ -68,6 +68,11 @@ class SessionKeeper throw e; } + if(_coordinator.getCommunicator().getDefaultRouter() == null) + { + _admin = AdminPrxHelper.uncheckedCast(_admin.ice_endpoints(session.ice_getEndpoints())); + } + _thread = new Pinger(_session, keepAliveperiod); _thread.start(); |