Community
Participate
Working Groups
Now that we're a multithreaded library we need to ensure that we are thread safe and that thread safety is documented. A couple of methods that are not thread safe: * Policy#getLog() * Policy#setLog(...) * AbstactObservable#dispose()
add/remove listener methods should be made thread safe too.
I started looking at ths and we probably also want to check for the current realm in: * setValue * fire*Event The only issue is that in order to provide this check in setValue we'll need to make it final and provide a template method like in getValue. This will break all observable value implementations. I don't mind doing it, just want to make sure you don't have other plans/ideas.
On the Nov. 30th data binding call we agreed that we need to follow the same pattern for setValue as we did for getValue (make setValue final and provide a doSetValue template method). We also need to make changes to ObservableSet, ObservableList, etc.
Target Milestone is 3.3M4
Created attachment 54950 [details] doSetValue patch Changes to AbstractObservableValue and all observables to implement doSetValue. The only unexpected change was creating doSetApprovedValue(...) in AbstractVetoableValue to ensure that the consumer didn't override doSetValue.
Created attachment 54965 [details] patch Contains the previous changes for doSetValue and the following: AbstractObservable ================== public synchronized void addChangeListener(IChangeListener listener) public synchronized void removeChangeListener(IChangeListener listener) public synchronized void addStaleListener(IStaleListener listener) public synchronized void removeStaleListener(IStaleListener listener) protected synchronized boolean hasListeners() public synchronized void dispose() added checkRealm() to: fireChange() fireStale() AbstractObservableValue ======================= public synchronized void addValueChangeListener(IValueChangeListener listener) public synchronized void removeValueChangeListener(IValueChangeListener listener) protected synchronized boolean hasListeners() public synchronized void dispose() AbstractVetoableValue ===================== public synchronized void addValueChangingListener(IValueChangingListener listener) public synchronized void removeValueChangingListener(IValueChangingListener listener) added checkRealm() to: fireValueChanging() Policy ====== public static synchronized void setLog(ILogger logger) public static synchronized ILogger getLog()
Patch released >20061204.
I've got a little more work to do. I need to apply the same concepts to lists, sets, and trees as well.
I didn't get all of this in for 3.3M4, pushing to 3.3M5.
I'm going to have to push the rest of this to M6. I doubt I'll have time to complete it before M5. I don't believe that there were any API changes needed. I just need to go through and checking realms and synchronizing listeners for Sets.
Moving to 3.3M7.
FIXED > 20070411.
VERIFIED in I20070502-1336