summaryrefslogtreecommitdiff
path: root/java/src/IceGridGUI/Coordinator.java
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2012-08-30 02:31:05 +0200
committerJose <jose@zeroc.com>2012-08-30 02:31:05 +0200
commit93739f7abfb1506c7ec06de535e27dc4229193ef (patch)
treed2299fadc247ae6f9b71a1deb08bddd7bd3f351c /java/src/IceGridGUI/Coordinator.java
parentFIX Java 7 warnings (diff)
downloadice-93739f7abfb1506c7ec06de535e27dc4229193ef.tar.bz2
ice-93739f7abfb1506c7ec06de535e27dc4229193ef.tar.xz
ice-93739f7abfb1506c7ec06de535e27dc4229193ef.zip
IceGridGUI Metrics Graphs
Diffstat (limited to 'java/src/IceGridGUI/Coordinator.java')
-rw-r--r--java/src/IceGridGUI/Coordinator.java114
1 files changed, 114 insertions, 0 deletions
diff --git a/java/src/IceGridGUI/Coordinator.java b/java/src/IceGridGUI/Coordinator.java
index 208093d2ab5..85993ae32da 100644
--- a/java/src/IceGridGUI/Coordinator.java
+++ b/java/src/IceGridGUI/Coordinator.java
@@ -66,6 +66,10 @@ import com.jgoodies.looks.plastic.PlasticLookAndFeel;
import IceGrid.*;
+import IceGridGUI.LiveDeployment.GraphView;
+import IceGridGUI.LiveDeployment.GraphView.GraphType;
+import IceGridGUI.LiveDeployment.GraphView.GraphCategory;
+
//
// This class coordinates the communications between the various objects
// that make up the IceGrid GUI.
@@ -346,6 +350,20 @@ public class Coordinator
_newTemplateMenu.add(_appActionsForMenu.get(IceGridGUI.Application.TreeNode.NEW_TEMPLATE_SERVER_ICEBOX));
_newTemplateMenu.add(_appActionsForMenu.get(IceGridGUI.Application.TreeNode.NEW_TEMPLATE_SERVICE));
+
+ //
+ // New Graph sub-menu
+ //
+ _newMenu.addSeparator();
+ _newGraphMenu = new JMenu("Graph");
+ _newGraphMenu.setEnabled(false);
+ _newMenu.add(_newGraphMenu);
+ _newGraphMenu.add(_newDispatchGraph);
+ _newGraphMenu.add(_newInvocationGraph);
+ _newGraphMenu.add(_newConnectionsGraph);
+ _newGraphMenu.add(_newThreadsGraph);
+ _newGraphMenu.add(_newBandwidthGraph);
+
fileMenu.addSeparator();
fileMenu.add(_login);
fileMenu.add(_logout);
@@ -1959,6 +1977,22 @@ public class Coordinator
{
public void actionPerformed(ActionEvent e)
{
+ if(_graphViews.size() > 0)
+ {
+ if(JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(getMainFrame(),
+ "Close all open Graph Views and logout?",
+ "Confirm logout",
+ JOptionPane.YES_NO_OPTION))
+ {
+ return;
+ }
+
+ java.util.List<GraphView> views = new java.util.ArrayList<GraphView>(_graphViews);
+ for(GraphView v : views)
+ {
+ v.close();
+ }
+ }
_sessionKeeper.logout(true);
}
};
@@ -1998,6 +2032,54 @@ public class Coordinator
"Release exclusive write access on the registry");
_releaseExclusiveWriteAccess.setEnabled(false);
+ _newDispatchGraph = new AbstractAction("Dispatch")
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ _graphViews.add(new GraphView(Coordinator.this, GraphType.TotalAverageGraphType,
+ GraphCategory.DispatchGraphCategory, "Operation Dispatch",
+ "Dispatch"));
+ }
+ };
+
+ _newInvocationGraph = new AbstractAction("Invocation")
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ _graphViews.add(new GraphView(Coordinator.this, GraphType.TotalAverageGraphType,
+ GraphCategory.InvocationsGraphCategory, "Remote Invocation",
+ "Invocation"));
+ }
+ };
+
+ _newConnectionsGraph = new AbstractAction("Connections")
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ _graphViews.add(new GraphView(Coordinator.this, GraphType.CurrentCountGraphType,
+ GraphCategory.ConnectionsGraphCategory, "Connections",
+ "Connection"));
+ }
+ };
+
+ _newThreadsGraph = new AbstractAction("Threads")
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ _graphViews.add(new GraphView(Coordinator.this, GraphType.CurrentCountGraphType,
+ GraphCategory.ThreadsGraphCategory, "Threads", "Thread"));
+ }
+ };
+
+ _newBandwidthGraph = new AbstractAction("Bandwidth")
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ _graphViews.add(new GraphView(Coordinator.this, GraphType.BandwidhGraphType,
+ GraphCategory.BandwidthGraphCategory, "Bandwidth", "Connection"));
+ }
+ };
+
_showLiveDeploymentFilters = new AbstractAction("Filter live deployment")
{
public void actionPerformed(ActionEvent e)
@@ -2530,6 +2612,23 @@ public class Coordinator
void exit(int status)
{
+ if(_graphViews.size() > 0)
+ {
+ if(JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(getMainFrame(),
+ "Close all open windows and exit?",
+ "Confirm exit",
+ JOptionPane.YES_NO_OPTION))
+ {
+ return;
+ }
+
+ java.util.List<GraphView> views = new java.util.ArrayList<GraphView>(_graphViews);
+ for(GraphView v : views)
+ {
+ v.close();
+ }
+ }
+
if(_openChooser != null)
{
File dir = _openChooser.getCurrentDirectory();
@@ -2702,6 +2801,11 @@ public class Coordinator
_serviceMenu.setEnabled(false);
}
+ public void removeGraphView(GraphView view)
+ {
+ _graphViews.remove(view);
+ }
+
public boolean traceObservers()
{
return _traceObservers;
@@ -2726,6 +2830,7 @@ public class Coordinator
{
_connected = connected;
_statusBar.setConnected(connected);
+ _newGraphMenu.setEnabled(connected);
}
public boolean connected()
@@ -2791,6 +2896,12 @@ public class Coordinator
private Action _acquireExclusiveWriteAccess;
private Action _releaseExclusiveWriteAccess;
+ private Action _newDispatchGraph;
+ private Action _newInvocationGraph;
+ private Action _newConnectionsGraph;
+ private Action _newThreadsGraph;
+ private Action _newBandwidthGraph;
+
private Action _showLiveDeploymentFilters;
private Action _openApplicationFromFile;
private Action _openApplicationFromRegistry;
@@ -2841,6 +2952,7 @@ public class Coordinator
private JMenu _newServerMenu;
private JMenu _newServiceMenu;
private JMenu _newTemplateMenu;
+ private JMenu _newGraphMenu;
private JMenu _appMenu;
private JMenu _nodeMenu;
private JMenu _registryMenu;
@@ -2858,5 +2970,7 @@ public class Coordinator
private String _fileParser;
private boolean _connected;
+ private java.util.List<GraphView> _graphViews = new java.util.ArrayList<GraphView>();
+
static private final int HISTORY_MAX_SIZE = 20;
}