summaryrefslogtreecommitdiff
path: root/java/src/IceGridGUI/Coordinator.java
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2014-07-23 15:06:02 -0230
committerMatthew Newhook <matthew@zeroc.com>2014-07-23 15:06:02 -0230
commit866f9ff17391176b836f9bb49f6da40c2c938441 (patch)
tree7366963294ef3356c7b887cd89af753988c21beb /java/src/IceGridGUI/Coordinator.java
parentadding ACM tests for Python/Ruby/PHP (diff)
downloadice-866f9ff17391176b836f9bb49f6da40c2c938441.tar.bz2
ice-866f9ff17391176b836f9bb49f6da40c2c938441.tar.xz
ice-866f9ff17391176b836f9bb49f6da40c2c938441.zip
ICE-4234 - Update Ice to use current Java threading constructs
- Use ScheduledThreadPoolDispatcher not IceUtilInternal.Timer. - Use Ice timer in glacier2, Freeze impl. - Align C++, C# with java changes. - Database demo now supports mariadb.
Diffstat (limited to 'java/src/IceGridGUI/Coordinator.java')
-rw-r--r--java/src/IceGridGUI/Coordinator.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/java/src/IceGridGUI/Coordinator.java b/java/src/IceGridGUI/Coordinator.java
index 911b05a388d..2f861b4f8cc 100644
--- a/java/src/IceGridGUI/Coordinator.java
+++ b/java/src/IceGridGUI/Coordinator.java
@@ -3150,6 +3150,20 @@ public class Coordinator
_liveDeploymentPane = new LiveDeploymentPane(_liveDeploymentRoot);
_mainPane = new MainPane(this);
_mainFrame.getContentPane().add(_mainPane, BorderLayout.CENTER);
+
+ java.util.concurrent.ScheduledThreadPoolExecutor executor =
+ new java.util.concurrent.ScheduledThreadPoolExecutor(1,
+ new java.util.concurrent.ThreadFactory()
+ {
+ public Thread newThread(Runnable r)
+ {
+ Thread t = new Thread(r);
+ t.setName("Pinger");
+ return t;
+ }
+ });
+ executor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
+ _executor = executor;
}
public IGraphView createGraphView()
@@ -3349,6 +3363,10 @@ public class Coordinator
destroyIceGridAdmin();
destroyCommunicator();
destroyWizardCommunicator();
+
+ _executor.shutdown();
+ _executor = null;
+
Runtime.getRuntime().removeShutdownHook(_shutdownHook);
_mainFrame.dispose();
Runtime.getRuntime().exit(status);
@@ -3648,6 +3666,11 @@ public class Coordinator
return _graphViews.toArray(new IGraphView[_graphViews.size()]);
}
+ public java.util.concurrent.ScheduledExecutorService getExecutor()
+ {
+ return _executor;
+ }
+
//
// May run in any thread
//
@@ -3896,5 +3919,7 @@ public class Coordinator
private java.util.List<IGraphView> _graphViews = new java.util.ArrayList<IGraphView>();
+ private java.util.concurrent.ScheduledExecutorService _executor;
+
static private final int HISTORY_MAX_SIZE = 20;
}