diff options
Diffstat (limited to 'java/src')
-rwxr-xr-x | java/src/IceGridGUI/Coordinator.java | 40 | ||||
-rwxr-xr-x | java/src/IceGridGUI/LiveActions.java | 4 | ||||
-rwxr-xr-x | java/src/IceGridGUI/LiveDeployment/Root.java | 89 | ||||
-rwxr-xr-x | java/src/IceGridGUI/LiveDeployment/Server.java | 6 | ||||
-rwxr-xr-x | java/src/IceGridGUI/LiveDeployment/TreeNode.java | 4 |
5 files changed, 126 insertions, 17 deletions
diff --git a/java/src/IceGridGUI/Coordinator.java b/java/src/IceGridGUI/Coordinator.java index 3283536aaad..3c0e82e9fbe 100755 --- a/java/src/IceGridGUI/Coordinator.java +++ b/java/src/IceGridGUI/Coordinator.java @@ -225,7 +225,7 @@ public class Coordinator _appMenu = new JMenu("Application");
_appMenu.setEnabled(false);
toolsMenu.add(_appMenu);
- _appMenu.add(_installDistribution);
+ _appMenu.add(_patchApplication);
//
// Node sub-menu
@@ -256,7 +256,7 @@ public class Coordinator _serverMenu.add(_liveActionsForMenu.get(IceGridGUI.LiveDeployment.TreeNode.DISABLE));
_serverMenu.addSeparator();
_serverMenu.add(_liveActionsForMenu.get(
- IceGridGUI.LiveDeployment.TreeNode.SERVER_INSTALL_DISTRIBUTION));
+ IceGridGUI.LiveDeployment.TreeNode.PATCH_SERVER));
//
// Service sub-menu
@@ -780,6 +780,7 @@ public class Coordinator _logout.setEnabled(false);
_openApplicationFromRegistry.setEnabled(false);
+ _patchApplication.setEnabled(false);
_newApplicationWithDefaultTemplates.setEnabled(false);
_acquireExclusiveWriteAccess.setEnabled(false);
_releaseExclusiveWriteAccess.setEnabled(false);
@@ -939,6 +940,7 @@ public class Coordinator _logout.setEnabled(true);
_openApplicationFromRegistry.setEnabled(true);
+ _patchApplication.setEnabled(true);
_newApplicationWithDefaultTemplates.setEnabled(true);
_acquireExclusiveWriteAccess.setEnabled(true);
@@ -1549,16 +1551,36 @@ public class Coordinator }
};
- _installDistribution = new AbstractAction("Patch distribution")
+ _patchApplication = new AbstractAction("Patch distribution")
{
public void actionPerformed(ActionEvent e)
{
- //
- // TODO: select a live application
- //
+ Object[] applicationNames = _liveDeploymentRoot.getPatchableApplicationNames();
+
+ if(applicationNames.length == 0)
+ {
+ JOptionPane.showMessageDialog(
+ _mainFrame,
+ "No application in this IceGrid registry can be patched",
+ "No application",
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+ else
+ {
+ String appName = (String)JOptionPane.showInputDialog(
+ _mainFrame, "Which Application do you want to patch?",
+ "Patch application",
+ JOptionPane.QUESTION_MESSAGE, null,
+ applicationNames, applicationNames[0]);
+
+ if(appName != null)
+ {
+ _liveDeploymentRoot.patch(appName);
+ }
+ }
}
};
- _installDistribution.setEnabled(false);
+ _patchApplication.setEnabled(false);
_showVarsMenuItem = new
JCheckBoxMenuItem(_appActionsForMenu.get(IceGridGUI.Application.TreeNode.SHOW_VARS));
@@ -1831,7 +1853,7 @@ public class Coordinator availableActions[IceGridGUI.LiveDeployment.TreeNode.STOP] ||
availableActions[IceGridGUI.LiveDeployment.TreeNode.ENABLE] ||
availableActions[IceGridGUI.LiveDeployment.TreeNode.DISABLE] ||
- availableActions[IceGridGUI.LiveDeployment.TreeNode.SERVER_INSTALL_DISTRIBUTION]);
+ availableActions[IceGridGUI.LiveDeployment.TreeNode.PATCH_SERVER]);
_serviceMenu.setEnabled(false);
}
@@ -1924,7 +1946,7 @@ public class Coordinator private Action _copying;
private Action _warranty;
private Action _about;
- private Action _installDistribution;
+ private Action _patchApplication;
//
// Two sets of actions because the popup's target and the menu/toolbar's target
diff --git a/java/src/IceGridGUI/LiveActions.java b/java/src/IceGridGUI/LiveActions.java index 1f7335f9569..4ec98b3f3ae 100755 --- a/java/src/IceGridGUI/LiveActions.java +++ b/java/src/IceGridGUI/LiveActions.java @@ -103,12 +103,12 @@ public class LiveActions }
};
- _array[TreeNode.SERVER_INSTALL_DISTRIBUTION] =
+ _array[TreeNode.PATCH_SERVER] =
new AbstractAction("Patch distribution")
{
public void actionPerformed(ActionEvent e)
{
- _target.serverInstallDistribution();
+ _target.patchServer();
}
};
diff --git a/java/src/IceGridGUI/LiveDeployment/Root.java b/java/src/IceGridGUI/LiveDeployment/Root.java index c9776c1d002..6b519060f7e 100755 --- a/java/src/IceGridGUI/LiveDeployment/Root.java +++ b/java/src/IceGridGUI/LiveDeployment/Root.java @@ -56,6 +56,25 @@ public class Root extends ListTreeNode {
return _descriptorMap.keySet().toArray();
}
+
+ public Object[] getPatchableApplicationNames()
+ {
+ java.util.List result = new java.util.ArrayList();
+
+ java.util.Iterator p = _descriptorMap.entrySet().iterator();
+ while(p.hasNext())
+ {
+ java.util.Map.Entry entry = (java.util.Map.Entry)p.next();
+
+ ApplicationDescriptor app = (ApplicationDescriptor)entry.getValue();
+ if(app.distrib.icepatch.length() > 0)
+ {
+ result.add(entry.getKey());
+ }
+ }
+ return result.toArray();
+ }
+
public Editor getEditor()
{
@@ -131,6 +150,74 @@ public class Root extends ListTreeNode _tree.setRootVisible(false);
}
+ public void patch(final String applicationName)
+ {
+ int shutdown = JOptionPane.showConfirmDialog(
+ getCoordinator().getMainFrame(),
+ "You are about to install or refresh your"
+ + " application distribution.\n"
+ + " Do you want shut down all servers affected by this update?",
+ "Patch Confirmation",
+ JOptionPane.YES_NO_CANCEL_OPTION);
+
+ if(shutdown == JOptionPane.CANCEL_OPTION)
+ {
+ return;
+ }
+
+ final String prefix = "Patching application '" + applicationName + "'...";
+
+
+ System.err.println("Not yet implemented!");
+
+ // TODO: implement once patchApplication is fixed!
+
+ /*
+ _coordinator.getStatusBar().setText(prefix);
+ AMI_Admin_patchApplication cb = new AMI_Admin_patchApplication()
+ {
+ //
+ // Called by another thread!
+ //
+ public void ice_response()
+ {
+ amiSuccess(prefix);
+ }
+
+ public void ice_exception(Ice.UserException e)
+ {
+ amiFailure(prefix, "Failed to patch '"
+ + applicationName + "'", e);
+ }
+
+ public void ice_exception(Ice.LocalException e)
+ {
+ amiFailure(prefix, "Failed to patch '" +
+ applicationName + "'", e.toString());
+ }
+ };
+
+ try
+ {
+ _coordinator.getMainFrame().setCursor(
+ Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ _coordinator.getAdmin().
+ patchApplication_async(cb, applicationName,
+ shutdown == JOptionPane.YES_OPTION);
+ }
+ catch(Ice.LocalException e)
+ {
+ failure(prefix, "Failed to patch " + _id, e.toString());
+ }
+ finally
+ {
+ _coordinator.getMainFrame().setCursor(
+ Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ }
+ */
+ }
+
+
//
// From the Registry Observer:
//
@@ -370,7 +457,7 @@ public class Root extends ListTreeNode public JPopupMenu getPopupMenu()
{
- LiveActions la = getCoordinator().getLiveActionsForPopup();
+ LiveActions la = _coordinator.getLiveActionsForPopup();
if(_popup == null)
{
diff --git a/java/src/IceGridGUI/LiveDeployment/Server.java b/java/src/IceGridGUI/LiveDeployment/Server.java index 0ac8aaa4da3..fc0e7cc6f47 100755 --- a/java/src/IceGridGUI/LiveDeployment/Server.java +++ b/java/src/IceGridGUI/LiveDeployment/Server.java @@ -40,7 +40,7 @@ class Server extends ListArrayTreeNode actions[STOP] = _state != ServerState.Inactive;
actions[ENABLE] = !_enabled;
actions[DISABLE] = _enabled;
- actions[SERVER_INSTALL_DISTRIBUTION] =
+ actions[PATCH_SERVER] =
!_serverDescriptor.distrib.icepatch.equals("");
}
@@ -143,7 +143,7 @@ class Server extends ListArrayTreeNode enableServer(false);
}
- public void serverInstallDistribution()
+ public void patchServer()
{
int shutdown = JOptionPane.showConfirmDialog(
getCoordinator().getMainFrame(),
@@ -262,7 +262,7 @@ class Server extends ListArrayTreeNode _popup.add(la.get(ENABLE));
_popup.add(la.get(DISABLE));
_popup.addSeparator();
- _popup.add(la.get(SERVER_INSTALL_DISTRIBUTION));
+ _popup.add(la.get(PATCH_SERVER));
}
la.setTarget(this);
diff --git a/java/src/IceGridGUI/LiveDeployment/TreeNode.java b/java/src/IceGridGUI/LiveDeployment/TreeNode.java index 2c89431a660..02081667e24 100755 --- a/java/src/IceGridGUI/LiveDeployment/TreeNode.java +++ b/java/src/IceGridGUI/LiveDeployment/TreeNode.java @@ -38,7 +38,7 @@ public abstract class TreeNode extends TreeNodeBase public static final int DISABLE = 3;
public static final int SHUTDOWN_NODE = 4;
- public static final int SERVER_INSTALL_DISTRIBUTION = 5;
+ public static final int PATCH_SERVER = 5;
public static final int ADD_OBJECT = 6;
@@ -69,7 +69,7 @@ public abstract class TreeNode extends TreeNodeBase {
assert false;
}
- public void serverInstallDistribution()
+ public void patchServer()
{
assert false;
}
|