Commit f2c650ef authored by legoc's avatar legoc

Merge branch 'change-event-process-order'

parents 7e0a75a3 94bf9b9c
3.0.5-SNAPSHOT
--------------
* Catch exception thrown when trying to format a invalid float value (avoid a client crash : see brisp 03 nov 2016).
3.1.1
-----
* Catch exception thrown when trying to format a invalid float value (avoid a client crash : see brisp 03 nov 2016).
* Replaced Corba with Cameo.
3.0.4
-----
......@@ -20,7 +21,6 @@
3.0.0
-----
* First release with Maven build process management.
* "GUI zero-crash" mode.
* Inherited controllers / drivers management.
......
......@@ -83,13 +83,23 @@ public class DataNotificationClient {
}
return instance;
}
private void updatePendingChanges(INotificationData change) {
// We do not add the change at the end of the list if it is already there.
// We used to move it at the end but some priority inversion could lead to problems.
if (!pendingChanges.contains(change)) {
pendingChanges.add(change);
} else {
//System.out.println("Not adding " + change);
}
}
public void propertyChanged(int databaseID, int propertyID) {
//System.out.println("Got property change with ID " + propertyID);
synchronized (pendingChanges) {
PropertyChangedNotificationData change = new PropertyChangedNotificationData(databaseID, propertyID);
pendingChanges.remove(change);
pendingChanges.add(change);
updatePendingChanges(change);
}
}
......@@ -97,8 +107,7 @@ public class DataNotificationClient {
//System.out.println("Got command state change with ID " + commandID + " with " + state);
synchronized (pendingChanges) {
CommandStateChangedNotificationData change = new CommandStateChangedNotificationData(databaseID, commandID, state);
pendingChanges.remove(change);
pendingChanges.add(change);
updatePendingChanges(change);
}
}
......@@ -106,40 +115,40 @@ public class DataNotificationClient {
//System.out.println("Got command progression change with ID " + commandID);
synchronized (pendingChanges) {
CommandProgressionChangedNotificationData change = new CommandProgressionChangedNotificationData(databaseID, commandID, progression);
pendingChanges.remove(change);
pendingChanges.add(change);
updatePendingChanges(change);
}
}
public void configurationChanged(int databaseID, int servantID, ClientEnableState enable) {
synchronized (pendingChanges) {
ConfigurationChangedNotificationData change = new ConfigurationChangedNotificationData(databaseID, servantID, enable);
pendingChanges.remove(change);
pendingChanges.add(change);
updatePendingChanges(change);
}
}
public void conditionStateChanged(int conditionId, boolean on, ClientConditionState clientState) {
synchronized (pendingChanges) {
ConditionStateChangedNotificationData change = new ConditionStateChangedNotificationData(conditionId, on, clientState);
pendingChanges.remove(change);
pendingChanges.add(change);
updatePendingChanges(change);
}
}
public void conditionActionsStateChanged(int conditionId, ClientConditionState clientState) {
synchronized (pendingChanges) {
ConditionActionsStateChangedNotificationData change = new ConditionActionsStateChangedNotificationData(conditionId, clientState);
pendingChanges.remove(change);
pendingChanges.add(change);
updatePendingChanges(change);
}
}
public void errorOccurred(String serverId, String message) {
synchronized (pendingServerErrors) {
ServerErrorEvent change = new ServerErrorEvent(serverId, "", "", message);
pendingChanges.remove(change);
pendingServerErrors.add(change);
// We do not add the change at the end of the list if it is already there.
// We used to move it at the end but some priority inversion could lead to problems.
if (!pendingServerErrors.contains(change)) {
pendingServerErrors.add(change);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment