+
+ private void notifyOthers(long entityId, String entityType) {
+ notifyOthers(entityId, entityType, null);
+ }
+
+ private void notifyOthers(long entityId, String entityType, String newGroupId) {
+ logger.debug("notifyOthers(long entityId, String entityType, long newGroupId) as notifyOthers(" + entityId
+ + "," + entityType + "," + newGroupId + ") called");
+ LinkedList<Thread> notifyThreads = new LinkedList<>();
+
+ // we're going to run notifications in parallel threads to speed things up
+ for (Object obj : otherServers) {
+ Thread newNotifyThread = new Thread(new NotifyOtherThread(obj, entityId, entityType, newGroupId));
+ newNotifyThread.start();
+ notifyThreads.add(newNotifyThread);
+ }
+ // we want to wait for all notifications to complete or timeout before we unlock the interface and allow
+ // more changes
+ for (Thread t : notifyThreads) {
+ try {
+ t.join();
+ } catch (Exception e) {
+ logger.warn("Could not join a notifcation thread" + e);
+ }
+ }
+ }