summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-12-01 16:58:32 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2011-12-01 16:58:32 +0000
commitb583f8db1e9df5df5f7feb7f8f1d8932e4a52674 (patch)
treeaf41a5f56f4af92821a31e7b1020d178516f5aa5 /sca-java-2.x/trunk/modules
parent092551bd4fcaabf20fe8698a2b95dcc84549421f (diff)
Add a contributionInstalled() operation to the listener interface. Completes the set.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1209150 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r--sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java2
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/DomainRegistryImpl.java3
-rw-r--r--sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java3
-rw-r--r--sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java3
4 files changed, 11 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java
index d1eba27a79..8fe6539cae 100644
--- a/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java
+++ b/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java
@@ -22,6 +22,8 @@ package org.apache.tuscany.sca.runtime;
import java.util.EventListener;
public interface ContributionListener extends EventListener {
+
+ void contributionInstalled(String uri);
void contributionRemoved(String uri);
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 08d71fd357..d0eb5c744e 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
@@ -204,6 +204,9 @@ public class DomainRegistryImpl extends BaseDomainRegistry implements DomainRegi
public void installContribution(ContributionDescription cd) {
contributionDescriptions.put(cd.getURI(), cd);
+ for (ContributionListener listener : contributionlisteners) {
+ listener.contributionInstalled(cd.getURI());
+ }
}
public void uninstallContribution(String uri) {
diff --git a/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java b/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
index d7a31a38ef..4faf7331ac 100644
--- a/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
+++ b/sca-java-2.x/trunk/modules/domain-hazelcast/src/main/java/org/apache/tuscany/sca/registry/hazelcast/HazelcastDomainRegistry.java
@@ -143,6 +143,9 @@ public class HazelcastDomainRegistry extends BaseDomainRegistry implements Domai
contributionDescriptions = hazelcastInstance.getMap(domainURI + "/ContributionDescriptions");
((IMap<String, ContributionDescription>)contributionDescriptions).addEntryListener(new EntryListener<String, ContributionDescription>() {
public void entryAdded(EntryEvent<String, ContributionDescription> event) {
+ for (ContributionListener listener : contributionlisteners) {
+ listener.contributionInstalled(event.getKey());
+ }
}
public void entryRemoved(EntryEvent<String, ContributionDescription> event) {
for (ContributionListener listener : contributionlisteners) {
diff --git a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
index 9064f57533..b56765f3c5 100644
--- a/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
+++ b/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
@@ -99,6 +99,9 @@ public class NodeImpl implements Node {
extensionPointRegistry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(ActiveNodes.class).getActiveNodes().add(this);
domainRegistry.addContributionListener(new ContributionListener() {
+ public void contributionInstalled(String uri) {
+ // Do nothing
+ }
public void contributionUpdated(String uri) {
unloadContribution(uri);
}