summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2012-03-19 13:29:34 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2012-03-19 13:29:34 +0000
commit81026b101775164b0d0c6c7a0daab96e697a66cd (patch)
treea7957f595621ebdf4298aa0381694b8d42e0cefc /sca-java-2.x/trunk/modules/core
parentc11ae887b90244b0f00d72d0cb0c366660043980 (diff)
TUSCANY-4025 - enhance the previous fix for this JIRA to call the listeners in reverse order. Node listeners will be added before other listeners that deal with the nodes contributions so we want the contribution to hang around in the node until all the other listeners have done their thing.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1302422 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java
index d98ecee1dc..21e1e4cf38 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java
@@ -24,6 +24,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.ListIterator;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Callable;
@@ -210,7 +211,15 @@ public class DomainRegistryImpl extends BaseDomainRegistry implements DomainRegi
}
public void uninstallContribution(String uri) {
- for (ContributionListener listener : contributionlisteners) {
+ // TUSCANY-4025 - iterate through this list in reverse
+ // in the expectation that a node listener
+ // will appear in the list before and other
+ // listener that appears in the list and which
+ // relies on the node still have the contribution
+ // information.
+ ListIterator<ContributionListener> listenerIterator = contributionlisteners.listIterator(contributionlisteners.size());
+ while (listenerIterator.hasPrevious()) {
+ ContributionListener listener = listenerIterator.previous();
listener.contributionRemoved(uri);
}
contributionDescriptions.remove(uri);